Current Behavior

The Google Vertex-AI API supports a lables parameter to categorize and group requests. The VertexAiGeminiChatModel and corresponding options class currently do not support an approach to set labels on a request.

Expected Behavior

It would be desirable for the VertexAiGeminiChatModel and/or VertexAiGeminiChatOptions class to support the ability to set labels. Because labels are not part of the Google GenerationConfig structure (which is where options such as temperature and max tokens are set), it may or may not make sense for labels to be considered options; however, the ChatClient interface does not appear to have a better alternative for setting this type of request parameter. For that reason, perhaps a ChatOption is the best place for labels. Labels ares somewhat (if not exactly) analogous in purpose to OpenAI metadata (tagging requests) which are part of the OpenAIOptions, so this is another argument for labels to be part of VertexAiGeminiChatOptions.

Possible Example Enhancement:

var promptOptions = VertexAiGeminiChatOptions.builder().labels(Map.of("use", "training")).build();
chatClient.prompt().messages(userMessage).options(promptOptions).call().content();

Context

A current development partner uses Google Vertex-AI and takes advantage of the labels categorization for various business purposes. In order to move to SpringAI (technically wanting to move to Tanzu AI Solutions), it is desirable to be able to continue categorizing request with labels.

An practical alternative has not been identified (subclassing VertexAiGeminiChatOptions class will not work for this scenario).

Comment From: gm2552

I was going to propose/sumbit a PR for this feature request, but durning research today it turns out that the Vertex Java client does not expose labels (yet) as part of the API. I have yet to find a viable workaround in the Vertex API, so it is probable that this feature request will need to wait until the Vertex Java SDK is updated to accept labels.