EmbeddingsResult Class

  • java.lang.Object
    • com.azure.ai.inference.models.EmbeddingsResult

Implements

public final class EmbeddingsResult
implements JsonSerializable<EmbeddingsResult>

Representation of the response data from an embeddings request. Embeddings measure the relatedness of text strings and are commonly used for search, clustering, recommendations, and other similar scenarios.

Method Summary

Modifier and Type Method and Description
static EmbeddingsResult fromJson(JsonReader jsonReader)

Reads an instance of EmbeddingsResult from the JsonReader.

List<EmbeddingItem> getData()

Get the data property: Embedding values for the prompts submitted in the request.

String getId()

Get the id property: Unique identifier for the embeddings result.

String getModel()

Get the model property: The model ID used to generate this result.

EmbeddingsUsage getUsage()

Get the usage property: Usage counts for tokens input using the embeddings API.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static EmbeddingsResult fromJson(JsonReader jsonReader)

Reads an instance of EmbeddingsResult from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of EmbeddingsResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getData

public List<EmbeddingItem> getData()

Get the data property: Embedding values for the prompts submitted in the request.

Returns:

the data value.

getId

public String getId()

Get the id property: Unique identifier for the embeddings result.

Returns:

the id value.

getModel

public String getModel()

Get the model property: The model ID used to generate this result.

Returns:

the model value.

getUsage

public EmbeddingsUsage getUsage()

Get the usage property: Usage counts for tokens input using the embeddings API.

Returns:

the usage value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to