Class GoogleVertexAIServiceSettings
java.lang.Object
co.elastic.clients.elasticsearch.inference.GoogleVertexAIServiceSettings
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class GoogleVertexAIServiceSettings
extends Object
implements JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<GoogleVertexAIServiceSettings>Json deserializer forGoogleVertexAIServiceSettings -
Method Summary
Modifier and TypeMethodDescriptionfinal IntegerFor atext_embeddingtask, the number of dimensions the resulting output embeddings should have.final Stringlocation()The name of the location to use for the inference task for the Google Vertex AI inference task.final IntegerOnly applicable for thetext_embeddingtask type.final StringmodelId()The name of the model to use for the inference task.final StringThe name of the project to use for the Google Vertex AI inference task.provider()The name of the Google Model Garden Provider forcompletionandchat_completiontasks.final RateLimitSettingThis setting helps to minimize the number of rate limit errors returned from Google Vertex AI.rebuild()voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) final StringRequired - A valid service account in JSON format for the Google Vertex AI API.protected static voidsetupGoogleVertexAIServiceSettingsDeserializer(ObjectDeserializer<GoogleVertexAIServiceSettings.Builder> op) final StringThe URL for streamingcompletionandchat_completionrequests to a Google Model Garden provider endpoint.toString()final Stringurl()The URL for non-streamingcompletionrequests to a Google Model Garden provider endpoint.
-
Field Details
-
_DESERIALIZER
Json deserializer forGoogleVertexAIServiceSettings
-
-
Method Details
-
of
-
provider
The name of the Google Model Garden Provider forcompletionandchat_completiontasks. In order for a Google Model Garden endpoint to be usedprovidermust be defined and be other thangoogle. Modes:- Google Model Garden (third-party models): set
providerto a supported non-googlevalue and provideurland/orstreaming_url. - Google Vertex AI: omit
provideror set it togoogle. In this mode, do not seturlorstreaming_urland Elastic will construct the endpoint url fromlocation,model_id, andproject_idparameters.
API name:
provider - Google Model Garden (third-party models): set
-
url
The URL for non-streamingcompletionrequests to a Google Model Garden provider endpoint. If bothurlandstreaming_urlare provided, each is used for its respective mode. Ifstreaming_urlis not provided,urlis also used for streamingcompletionandchat_completion. Ifprovideris not provided or set togoogle(Google Vertex AI), do not seturl(orstreaming_url). At least one ofurlorstreaming_urlmust be provided for Google Model Garden endpoint usage. Certain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face). Information on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’sSample requestpage. The request examples also illustrate the proper formatting for theurl.API name:
url -
streamingUrl
The URL for streamingcompletionandchat_completionrequests to a Google Model Garden provider endpoint. If bothstreaming_urlandurlare provided, each is used for its respective mode. Ifurlis not provided,streaming_urlis also used for non-streamingcompletionrequests. Ifprovideris not provided or set togoogle(Google Vertex AI), do not setstreaming_url(orurl). At least one ofstreaming_urlorurlmust be provided for Google Model Garden endpoint usage. Certain providers require separate URLs for streaming and non-streaming operations (e.g., Anthropic, Mistral, AI21). Others support both operation types through a single URL (e.g., Meta, Hugging Face). Information on constructing the URL for various providers can be found in the Google Model Garden documentation for the model, or on the endpoint’sSample requestpage. The request examples also illustrate the proper formatting for thestreaming_url.API name:
streaming_url -
location
The name of the location to use for the inference task for the Google Vertex AI inference task. For Google Vertex AI, whenprovideris omitted orgoogle,locationis optional. Whenlocationis omitted, the request targets the Google Vertex AI global endpoint (https://aiplatform.googleapis.com); when it is provided, the corresponding regional endpoint (https://<location>-aiplatform.googleapis.com) is used. The field must be omitted to select the global endpoint; an empty string is not a validlocation. For Google Model Garden'scompletionandchat_completiontasks, whenprovideris a supported non-googlevalue -locationis ignored. Refer to the Google documentation for the list of supported locations.API name:
location -
modelId
The name of the model to use for the inference task. For Google Vertex AImodel_idis mandatory. For Google Model Garden'scompletionandchat_completiontasks, whenprovideris a supported non-googlevalue -model_idwill be used for some providers that require it, otherwise - ignored. Refer to the Google documentation for the list of supported models for Google Vertex AI.API name:
model_id -
projectId
The name of the project to use for the Google Vertex AI inference task. For Google Vertex AIproject_idis mandatory. For Google Model Garden'scompletionandchat_completiontasks, whenprovideris a supported non-googlevalue -project_idis ignored.API name:
project_id -
rateLimit
This setting helps to minimize the number of rate limit errors returned from Google Vertex AI. By default, thegooglevertexaiservice sets the number of requests allowed per minute to 30.000.API name:
rate_limit -
serviceAccountJson
Required - A valid service account in JSON format for the Google Vertex AI API.API name:
service_account_json -
dimensions
For atext_embeddingtask, the number of dimensions the resulting output embeddings should have. By default, the model's standard output dimension is used. Refer to the Google documentation for more information.API name:
dimensions -
maxBatchSize
Only applicable for thetext_embeddingtask type. Controls the batch size of chunked inference requests sent to Google Vertex AI.Setting this parameter lower reduces the risk of exceeding token limits but may result in more API calls. Setting it higher increases throughput but may risk hitting token limits.
To estimate a safe
max_batch_sizevalue, you can use it together with themax_chunk_sizeparameter using the following formula:max_batch_size ≈ max_chunk_size × 1.3 × 512 ÷ 20000Where:
1.3is an approximate tokens-per-word ratio512is the maximum number of chunks that can be generated per document20000is the Google Vertex AI token limit per request
This estimate assumes the worst-case scenario with a document generating the maximum 512 chunks.
API name:
max_batch_size -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
rebuild
- Returns:
- New
GoogleVertexAIServiceSettings.Builderinitialized with field values of this instance
-
setupGoogleVertexAIServiceSettingsDeserializer
protected static void setupGoogleVertexAIServiceSettingsDeserializer(ObjectDeserializer<GoogleVertexAIServiceSettings.Builder> op)
-