Class RequestEmbedding
java.lang.Object
co.elastic.clients.elasticsearch.inference.RequestEmbedding
- All Implemented Interfaces:
JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<RequestEmbedding>Json deserializer forRequestEmbedding -
Method Summary
Modifier and TypeMethodDescriptionfinal EmbeddingInputinput()Required - Inference input.final StringThe input data type for the embedding model.static RequestEmbeddingrebuild()voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal JsonDataTask settings for the individual inference request.toString()
-
Field Details
-
_DESERIALIZER
Json deserializer forRequestEmbedding
-
-
Method Details
-
of
public static RequestEmbedding of(Function<RequestEmbedding.Builder, ObjectBuilder<RequestEmbedding>> fn) -
input
Required - Inference input. Either a string, an array of strings, acontentobject, or an array ofcontentobjects.string example:
"input": "Some text"string array example:
"input": ["Some text", "Some more text"]contentobject example:"input": { "content": { "type": "image", "format": "base64", "value": "data:image/jpeg;base64,..." } }contentobject 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
The input data type for the embedding model. Possible values include:SEARCHINGESTCLASSIFICATIONCLUSTERING
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_typeparameter specified on the root level of the request body will take precedence over theinput_typeparameter specified intask_settings.API name:
input_type -
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
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
toString
-
rebuild
- Returns:
- New
RequestEmbedding.Builderinitialized with field values of this instance
-
setupRequestEmbeddingDeserializer
protected static void setupRequestEmbeddingDeserializer(ObjectDeserializer<RequestEmbedding.Builder> op)
-