Package com.azure.ai.openai.models
Class Embeddings
java.lang.Object
com.azure.ai.openai.models.Embeddings
- All Implemented Interfaces:
com.azure.json.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 TypeMethodDescriptionstatic EmbeddingsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of Embeddings from the JsonReader.getData()Get the data property: Embedding values for the prompts submitted in the request.getUsage()Get the usage property: Usage counts for tokens input using the embeddings API.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter)
-
Method Details
-
getData
Get the data property: Embedding values for the prompts submitted in the request.- Returns:
- the data value.
-
getUsage
Get the usage property: Usage counts for tokens input using the embeddings API.- Returns:
- the usage value.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<Embeddings>- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the Embeddings.
-