Class Embedding
-
- All Implemented Interfaces:
public final class Embedding
Represents an embedding vector returned by embedding endpoint.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
Embedding.Builder
A builder for Embedding.
-
Method Summary
Modifier and Type Method Description final List<Double>
embedding()
The embedding vector, which is a list of floats. final Long
index()
The index of the embedding in the list of embeddings. final JsonValue
_object_()
The object type, which is always "embedding". final JsonField<List<Double>>
_embedding()
Returns the raw JSON value of embedding. final JsonField<Long>
_index()
Returns the raw JSON value of index. final Map<String, JsonValue>
_additionalProperties()
final Embedding.Builder
toBuilder()
final Embedding
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static Embedding.Builder
builder()
Returns a mutable builder for constructing an instance of Embedding. -
-
Method Detail
-
embedding
final List<Double> embedding()
The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.
-
_object_
final JsonValue _object_()
The object type, which is always "embedding".
Expected to always return the following:
JsonValue.from("embedding")
However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
_embedding
final JsonField<List<Double>> _embedding()
Returns the raw JSON value of embedding.
Unlike embedding, this method doesn't throw if the JSON field has an unexpected type.
-
_index
final JsonField<Long> _index()
Returns the raw JSON value of index.
Unlike index, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Embedding.Builder toBuilder()
-
builder
final static Embedding.Builder builder()
Returns a mutable builder for constructing an instance of Embedding.
The following fields are required:
.embedding() .index()
-
-
-
-