Class GoogleVertexAIServiceSettings.Builder

All Implemented Interfaces:
WithJson<GoogleVertexAIServiceSettings.Builder>, ObjectBuilder<GoogleVertexAIServiceSettings>
Enclosing class:
GoogleVertexAIServiceSettings

public static class GoogleVertexAIServiceSettings.Builder extends WithJsonObjectBuilderBase<GoogleVertexAIServiceSettings.Builder> implements ObjectBuilder<GoogleVertexAIServiceSettings>
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • provider

      public final GoogleVertexAIServiceSettings.Builder provider(@Nullable GoogleModelGardenProvider value)
      The name of the Google Model Garden Provider for completion and chat_completion tasks. In order for a Google Model Garden endpoint to be used provider must be defined and be other than google. Modes:
      • Google Model Garden (third-party models): set provider to a supported non-google value and provide url and/or streaming_url.
      • Google Vertex AI: omit provider or set it to google. In this mode, do not set url or streaming_url and Elastic will construct the endpoint url from location, model_id, and project_id parameters.

      API name: provider

    • url

      public final GoogleVertexAIServiceSettings.Builder url(@Nullable String value)
      The URL for non-streaming completion requests to a Google Model Garden provider endpoint. If both url and streaming_url are provided, each is used for its respective mode. If streaming_url is not provided, url is also used for streaming completion and chat_completion. If provider is not provided or set to google (Google Vertex AI), do not set url (or streaming_url). At least one of url or streaming_url must be provided for Google Model Garden endpoint usage.

      API name: url

    • streamingUrl

      public final GoogleVertexAIServiceSettings.Builder streamingUrl(@Nullable String value)
      The URL for streaming completion and chat_completion requests to a Google Model Garden provider endpoint. If both streaming_url and url are provided, each is used for its respective mode. If url is not provided, streaming_url is also used for non-streaming completion requests. If provider is not provided or set to google (Google Vertex AI), do not set streaming_url (or url). At least one of streaming_url or url must be provided for Google Model Garden endpoint usage.

      API name: streaming_url

    • location

      public final GoogleVertexAIServiceSettings.Builder location(@Nullable String value)
      The name of the location to use for the inference task for the Google Vertex AI inference task. For Google Vertex AI, when provider is omitted or google location is mandatory. For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - location is ignored. Refer to the Google documentation for the list of supported locations.

      API name: location

    • modelId

      public final GoogleVertexAIServiceSettings.Builder modelId(@Nullable String value)
      The name of the model to use for the inference task. For Google Vertex AI model_id is mandatory. For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - model_id will 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

      public final GoogleVertexAIServiceSettings.Builder projectId(@Nullable String value)
      The name of the project to use for the Google Vertex AI inference task. For Google Vertex AI project_id is mandatory. For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - project_id is ignored.

      API name: project_id

    • rateLimit

      public final GoogleVertexAIServiceSettings.Builder rateLimit(@Nullable RateLimitSetting value)
      This setting helps to minimize the number of rate limit errors returned from Google Vertex AI. By default, the googlevertexai service sets the number of requests allowed per minute to 30.000.

      API name: rate_limit

    • rateLimit

      This setting helps to minimize the number of rate limit errors returned from Google Vertex AI. By default, the googlevertexai service sets the number of requests allowed per minute to 30.000.

      API name: rate_limit

    • serviceAccountJson

      public final GoogleVertexAIServiceSettings.Builder serviceAccountJson(String value)
      Required - A valid service account in JSON format for the Google Vertex AI API.

      API name: service_account_json

    • dimensions

      public final GoogleVertexAIServiceSettings.Builder dimensions(@Nullable Integer value)
      For a text_embedding task, 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

    • self

      Specified by:
      self in class WithJsonObjectBuilderBase<GoogleVertexAIServiceSettings.Builder>
    • build

      Specified by:
      build in interface ObjectBuilder<GoogleVertexAIServiceSettings>
      Throws:
      NullPointerException - if some of the required fields are null.