Class OpenShiftAiServiceSettings

java.lang.Object
co.elastic.clients.elasticsearch.inference.OpenShiftAiServiceSettings
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class OpenShiftAiServiceSettings extends Object implements JsonpSerializable
See Also:
  • Field Details

  • Method Details

    • of

    • apiKey

      public final String apiKey()
      Required - A valid API key for your OpenShift AI endpoint. Can be found in Token authentication section of model related information.

      API name: api_key

    • url

      public final String url()
      Required - The URL of the OpenShift AI hosted model endpoint.

      API name: url

    • modelId

      @Nullable public final String modelId()
      The name of the model to use for the inference task. Refer to the hosted model's documentation for the name if needed. Service has been tested and confirmed to be working with the following models:
      • For text_embedding task - gritlm-7b.
      • For completion and chat_completion tasks - llama-31-8b-instruct.
      • For rerank task - bge-reranker-v2-m3.

      API name: model_id

    • maxInputTokens

      @Nullable public final Integer maxInputTokens()
      For a text_embedding task, the maximum number of tokens per input before chunking occurs.

      API name: max_input_tokens

    • similarity

      @Nullable public final OpenShiftAiSimilarityType similarity()
      For a text_embedding task, the similarity measure. One of cosine, dot_product, l2_norm. If not specified, the default dot_product value is used.

      API name: similarity

    • rateLimit

      @Nullable public final RateLimitSetting rateLimit()
      This setting helps to minimize the number of rate limit errors returned from the OpenShift AI API. By default, the openshift_ai service sets the number of requests allowed per minute to 3000.

      API name: rate_limit

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • rebuild

      Returns:
      New OpenShiftAiServiceSettings.Builder initialized with field values of this instance
    • setupOpenShiftAiServiceSettingsDeserializer

      protected static void setupOpenShiftAiServiceSettingsDeserializer(ObjectDeserializer<OpenShiftAiServiceSettings.Builder> op)