Restricts function calling to only the specified function names.
Overrides the default API endpoint.
Sets the Google AI Gemini API key used to authenticate requests.
Sets the name of a previously created cached content resource to use with this model.
GoogleGenAiChatModel.Builder.client(com.google.genai.Client client)
Sets a pre-configured Google GenAI Client.
Sets extra HTTP headers to include in every request to the Google GenAI API.
GoogleGenAiChatModel.Builder.defaultRequestParameters(dev.langchain4j.model.chat.request.ChatRequestParameters defaultRequestParameters)
Sets default ChatRequestParameters that are merged into every request.
Enables the Google Maps grounding tool, allowing the model to retrieve
location-based information.
Enables the Google Search grounding tool, allowing the model to retrieve
real-time information from the web.
Enables the URL context tool, allowing the model to read and reason about
content at provided URLs.
Sets the frequency penalty, which reduces the likelihood of repeating tokens
proportionally to how often they have appeared in the response so far.
GoogleGenAiChatModel.Builder.googleCredentials(com.google.auth.oauth2.GoogleCredentials credentials)
Sets the Google OAuth2 credentials used to authenticate requests via Vertex AI.
Sets labels (key-value metadata) attached to the request.
GoogleGenAiChatModel.Builder.listeners(List<dev.langchain4j.model.chat.listener.ChatModelListener> listeners)
Sets the list of ChatModelListeners to be notified on each request and response.
Sets the Google Cloud region/location for Vertex AI access (e.g.
Enables debug logging of request details sent to the Google GenAI API.
Enables debug logging of both request and response details.
Enables debug logging of response details received from the Google GenAI API.
Sets the maximum number of tokens to generate in the response.
Sets the number of times to retry a request on transient errors (e.g. rate limits, server errors).
Sets the model to use for chat completions.
Sets the presence penalty, which reduces the likelihood of repeating any token
that has already appeared in the response, regardless of frequency.
Sets the Google Cloud project ID for Vertex AI access.
GoogleGenAiChatModel.Builder.responseFormat(dev.langchain4j.model.chat.request.ResponseFormat responseFormat)
Sets the response format, enabling structured output such as JSON mode or JSON Schema.
GoogleGenAiChatModel.Builder.safetySettings(List<com.google.genai.types.SafetySetting> safetySettings)
Sets safety content filter settings to block harmful content.
Sets the random seed for deterministic output.
Sets sequences that, when generated, will cause the model to stop generating further tokens.
Sets the sampling temperature in the range [0.0, 2.0].
The thinking budget to use.
The thinking level to use.
Sets the HTTP request timeout for calls to the Google GenAI API.
Sets the top-K sampling value.
Sets the nucleus sampling probability (top-p).
Sets the Vertex AI Search datastore to use for grounding the model's responses
with enterprise data.