Class Embedding.Builder
-
- All Implemented Interfaces:
public final class Embedding.Builder
A builder for Embedding.
-
-
Method Summary
Modifier and Type Method Description final Embedding.Builder
embedding(List<Float> embedding)
The embedding vector, which is a list of floats. final Embedding.Builder
embedding(JsonField<List<Float>> embedding)
Sets Builder.embedding to an arbitrary JSON value. final Embedding.Builder
addEmbedding(Float embedding)
Adds a single Float to Builder.embedding. final Embedding.Builder
index(Long index)
The index of the embedding in the list of embeddings. final Embedding.Builder
index(JsonField<Long> index)
Sets Builder.index to an arbitrary JSON value. final Embedding.Builder
object_(JsonValue object_)
Sets the field to an arbitrary JSON value. final Embedding.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final Embedding.Builder
putAdditionalProperty(String key, JsonValue value)
final Embedding.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final Embedding.Builder
removeAdditionalProperty(String key)
final Embedding.Builder
removeAllAdditionalProperties(Set<String> keys)
final Embedding
build()
Returns an immutable instance of Embedding. -
-
Method Detail
-
embedding
final Embedding.Builder embedding(List<Float> embedding)
The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the embedding guide.
-
embedding
final Embedding.Builder embedding(JsonField<List<Float>> embedding)
Sets Builder.embedding to an arbitrary JSON value.
You should usually call Builder.embedding with a well-typed
List<Float>
value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
addEmbedding
final Embedding.Builder addEmbedding(Float embedding)
Adds a single Float to Builder.embedding.
-
index
final Embedding.Builder index(Long index)
The index of the embedding in the list of embeddings.
-
index
final Embedding.Builder index(JsonField<Long> index)
Sets Builder.index to an arbitrary JSON value.
You should usually call Builder.index with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
object_
final Embedding.Builder object_(JsonValue object_)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("embedding")
This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final Embedding.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final Embedding.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final Embedding.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final Embedding.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final Embedding.Builder removeAllAdditionalProperties(Set<String> keys)
-
-
-
-