Compartir a través de


Embeddings Class

  • java.lang.Object
    • com.azure.ai.openai.models.Embeddings

Implements

public final class Embeddings
implements JsonSerializable<Embeddings>

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 Embeddings fromJson(JsonReader jsonReader)

Reads an instance of Embeddings from the JsonReader.

List<EmbeddingItem> getData()

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

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 Embeddings fromJson(JsonReader jsonReader)

Reads an instance of Embeddings from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of Embeddings 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 getData()

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

Returns:

the data 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