Class RequestEmbedding

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

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

  • Method Details

    • of

    • input

      public final EmbeddingInput input()
      Required - Inference input. Either a string, an array of strings, a content object, or an array of content objects.

      string example:

       "input": "Some text"
       
       

      string array example:

       "input": ["Some text", "Some more text"]
       
       

      content object example:

       "input": {
           "content": {
             "type": "image",
             "format": "base64",
             "value": "data:image/jpeg;base64,..."
           }
         }
       
       

      content object array example:

       "input": [
         {
           "content": {
             "type": "text",
             "format": "text",
             "value": "Some text to generate an embedding"
           }
         },
         {
           "content": {
             "type": "image",
             "format": "base64",
             "value": "data:image/jpeg;base64,..."
           }
         }
       ]
       
       

      API name: input

    • inputType

      @Nullable public final String inputType()
      The input data type for the embedding model. Possible values include:
      • SEARCH
      • INGEST
      • CLASSIFICATION
      • CLUSTERING

      Not all models 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()
      Task settings for the individual inference request. These settings are specific to the <task_type> you specified and override the task settings specified when initializing the service.

      API name: task_settings

    • 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

      public RequestEmbedding.Builder rebuild()
      Returns:
      New RequestEmbedding.Builder initialized with field values of this instance
    • setupRequestEmbeddingDeserializer

      protected static void setupRequestEmbeddingDeserializer(ObjectDeserializer<RequestEmbedding.Builder> op)