Class VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder
java.lang.Object
dev.langchain4j.model.vertexai.gemini.VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder
- Enclosing class:
VertexAiGeminiChatModel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedFunctionNames(List<String> allowedFunctionNames) apiEndpoint(String apiEndpoint) build()credentials(com.google.auth.oauth2.GoogleCredentials credentials) customHeaders(Map<String, String> customHeaders) Sets custom headers to be included in the LLM requests.Sets billing/reporting labels that will be attached to every request the model issues.listeners(List<ChatModelListener> listeners) logRequests(Boolean logRequests) logResponses(Boolean logResponses) maxOutputTokens(Integer maxOutputTokens) maxRetries(Integer maxRetries) responseMimeType(String responseMimeType) responseSchema(com.google.cloud.vertexai.api.Schema responseSchema) safetySettings(Map<HarmCategory, SafetyThreshold> safetySettings) supportedCapabilities(Capability... supportedCapabilities) supportedCapabilities(Set<Capability> supportedCapabilities) temperature(Float temperature) toolCallingMode(ToolCallingMode toolCallingMode) useGoogleSearch(Boolean useGoogleSearch) vertexSearchDatastore(String vertexSearchDatastore)
-
Constructor Details
-
VertexAiGeminiChatModelBuilder
public VertexAiGeminiChatModelBuilder()
-
-
Method Details
-
project
-
location
-
modelName
-
temperature
-
maxOutputTokens
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder maxOutputTokens(Integer maxOutputTokens) -
topK
-
topP
-
seed
-
maxRetries
-
responseMimeType
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder responseMimeType(String responseMimeType) -
responseSchema
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder responseSchema(com.google.cloud.vertexai.api.Schema responseSchema) -
safetySettings
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder safetySettings(Map<HarmCategory, SafetyThreshold> safetySettings) -
useGoogleSearch
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder useGoogleSearch(Boolean useGoogleSearch) -
vertexSearchDatastore
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder vertexSearchDatastore(String vertexSearchDatastore) -
toolCallingMode
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder toolCallingMode(ToolCallingMode toolCallingMode) -
allowedFunctionNames
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder allowedFunctionNames(List<String> allowedFunctionNames) -
logRequests
-
logResponses
-
listeners
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder listeners(List<ChatModelListener> listeners) -
supportedCapabilities
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder supportedCapabilities(Set<Capability> supportedCapabilities) -
supportedCapabilities
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder supportedCapabilities(Capability... supportedCapabilities) -
credentials
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder credentials(com.google.auth.oauth2.GoogleCredentials credentials) -
apiEndpoint
-
customHeaders
public VertexAiGeminiChatModel.VertexAiGeminiChatModelBuilder customHeaders(Map<String, String> customHeaders) Sets custom headers to be included in the LLM requests. Main use-case is to support provision throughput quota. E.g: "X-Vertex-AI-LLM-Request-Type: dedicated" will exhaust the provisioned throughput quota first, and will return HTTP_429 if the quota is exhausted. "X-Vertex-AI-LLM-Request-Type: shared" will bypass the provisioned throughput quota completely. For more information please refer to the official documentation- Parameters:
customHeaders- a map of custom header keys and their corresponding values- Returns:
- the updated instance of
VertexAiGeminiChatModelBuilder
-
labels
Sets billing/reporting labels that will be attached to every request the model issues.Vertex AI's
generateContentrequest body has a top-levellabelsmap intended for billing and reporting only. The labels surface in Cloud Billing reports (Group by → Labels) and in Cloud Logging audit entries when Data Access audit logs are enabled, allowing per-tenant cost attribution and request filtering.Per the official spec: keys must start with a letter; keys and values may use lowercase letters, digits, underscores, and dashes (international characters are allowed); each is at most 63 Unicode code points; up to 64 labels per request.
- Parameters:
labels- a map of label keys and their corresponding values- Returns:
- the updated instance of
VertexAiGeminiChatModelBuilder
-
build
-