Class Ai21ServiceSettings.Builder

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

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

    • Builder

      public Builder()
  • Method Details

    • modelId

      public final Ai21ServiceSettings.Builder modelId(String value)
      Required - The name of the model to use for the inference task. Refer to the AI21 models documentation for the list of supported models and versions. Service has been tested and confirmed to be working for completion and chat_completion tasks with the following models:
      • jamba-mini
      • jamba-large

      API name: model_id

    • apiKey

      public final Ai21ServiceSettings.Builder apiKey(@Nullable String value)
      A valid API key for accessing AI21 API.

      IMPORTANT: You need to provide the API key only once, during the inference model creation. The get inference endpoint API does not retrieve your API key. After creating the inference model, you cannot change the associated API key. If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key.

      API name: api_key

    • rateLimit

      public final Ai21ServiceSettings.Builder rateLimit(@Nullable RateLimitSetting value)
      This setting helps to minimize the number of rate limit errors returned from the AI21 API. By default, the ai21 service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details.

      API name: rate_limit

    • rateLimit

      This setting helps to minimize the number of rate limit errors returned from the AI21 API. By default, the ai21 service sets the number of requests allowed per minute to 200. Please refer to AI21 documentation for more details.

      API name: rate_limit

    • self

      protected Ai21ServiceSettings.Builder self()
      Specified by:
      self in class WithJsonObjectBuilderBase<Ai21ServiceSettings.Builder>
    • build

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