Class TextEmbeddingRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.inference.TextEmbeddingRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class TextEmbeddingRequest extends RequestBase implements JsonpSerializable
Perform text embedding inference on the service
See Also:
  • Field Details

  • Method Details

    • of

    • inferenceId

      public final String inferenceId()
      Required - The inference Id

      API name: inference_id

    • input

      public final List<String> input()
      Required - Inference input. Either a string or an array of strings.

      API name: input

    • inputType

      @Nullable public final String inputType()
      The input data type for the text embedding model. Possible values include:
      • SEARCH
      • INGEST
      • CLASSIFICATION
      • CLUSTERING Not all services support all values. Unsupported values will trigger a validation exception. Accepted values depend on the configured inference service, refer to the relevant service-specific documentation for more info.

      info The input_type parameter specified on the root level of the request body will take precedence over the input_type parameter specified in task_settings.

      API name: input_type

    • taskSettings

      @Nullable public final JsonData taskSettings()
      Optional task settings

      API name: task_settings

    • timeout

      @Nullable public final Time timeout()
      Specifies the amount of time to wait for the inference request to complete.

      API name: timeout

    • 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)
    • setupTextEmbeddingRequestDeserializer

      protected static void setupTextEmbeddingRequestDeserializer(ObjectDeserializer<TextEmbeddingRequest.Builder> op)