Class EmbeddingCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class EmbeddingCreateParams.Body.Builder
A builder for Body.
-
-
Method Summary
Modifier and Type Method Description final EmbeddingCreateParams.Body.Builder
input(EmbeddingCreateParams.Input input)
Input text to embed, encoded as a string or array of tokens. final EmbeddingCreateParams.Body.Builder
input(JsonField<EmbeddingCreateParams.Input> input)
Input text to embed, encoded as a string or array of tokens. final EmbeddingCreateParams.Body.Builder
input(String string)
The string that will be turned into an embedding. final EmbeddingCreateParams.Body.Builder
inputOfArrayOfStrings(List<String> arrayOfStrings)
The array of strings that will be turned into an embedding. final EmbeddingCreateParams.Body.Builder
inputOfArrayOfTokens(List<Long> arrayOfTokens)
The array of integers that will be turned into an embedding. final EmbeddingCreateParams.Body.Builder
inputOfArrayOfTokenArrays(List<List<Long>> arrayOfTokenArrays)
The array of arrays containing integers that will be turned into an embedding. final EmbeddingCreateParams.Body.Builder
model(EmbeddingModel model)
ID of the model to use. final EmbeddingCreateParams.Body.Builder
model(JsonField<EmbeddingModel> model)
ID of the model to use. final EmbeddingCreateParams.Body.Builder
model(String value)
ID of the model to use. final EmbeddingCreateParams.Body.Builder
dimensions(Long dimensions)
The number of dimensions the resulting output embeddings should have. final EmbeddingCreateParams.Body.Builder
dimensions(JsonField<Long> dimensions)
The number of dimensions the resulting output embeddings should have. final EmbeddingCreateParams.Body.Builder
encodingFormat(EmbeddingCreateParams.EncodingFormat encodingFormat)
The format to return the embeddings in. final EmbeddingCreateParams.Body.Builder
encodingFormat(JsonField<EmbeddingCreateParams.EncodingFormat> encodingFormat)
The format to return the embeddings in. final EmbeddingCreateParams.Body.Builder
user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final EmbeddingCreateParams.Body.Builder
user(JsonField<String> user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final EmbeddingCreateParams.Body.Builder
additionalProperties(Map<String, JsonValue> additionalProperties)
final EmbeddingCreateParams.Body.Builder
putAdditionalProperty(String key, JsonValue value)
final EmbeddingCreateParams.Body.Builder
putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
final EmbeddingCreateParams.Body.Builder
removeAdditionalProperty(String key)
final EmbeddingCreateParams.Body.Builder
removeAllAdditionalProperties(Set<String> keys)
final EmbeddingCreateParams.Body
build()
-
-
Method Detail
-
input
final EmbeddingCreateParams.Body.Builder input(EmbeddingCreateParams.Input input)
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for
text-embedding-ada-002
), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens. Some models may also impose a limit on total number of tokens summed across inputs.
-
input
final EmbeddingCreateParams.Body.Builder input(JsonField<EmbeddingCreateParams.Input> input)
Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for
text-embedding-ada-002
), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens. Some models may also impose a limit on total number of tokens summed across inputs.
-
input
final EmbeddingCreateParams.Body.Builder input(String string)
The string that will be turned into an embedding.
-
inputOfArrayOfStrings
final EmbeddingCreateParams.Body.Builder inputOfArrayOfStrings(List<String> arrayOfStrings)
The array of strings that will be turned into an embedding.
-
inputOfArrayOfTokens
final EmbeddingCreateParams.Body.Builder inputOfArrayOfTokens(List<Long> arrayOfTokens)
The array of integers that will be turned into an embedding.
-
inputOfArrayOfTokenArrays
final EmbeddingCreateParams.Body.Builder inputOfArrayOfTokenArrays(List<List<Long>> arrayOfTokenArrays)
The array of arrays containing integers that will be turned into an embedding.
-
model
final EmbeddingCreateParams.Body.Builder model(EmbeddingModel model)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
model
final EmbeddingCreateParams.Body.Builder model(JsonField<EmbeddingModel> model)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
model
final EmbeddingCreateParams.Body.Builder model(String value)
ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
-
dimensions
final EmbeddingCreateParams.Body.Builder dimensions(Long dimensions)
The number of dimensions the resulting output embeddings should have. Only supported in
text-embedding-3
and later models.
-
dimensions
final EmbeddingCreateParams.Body.Builder dimensions(JsonField<Long> dimensions)
The number of dimensions the resulting output embeddings should have. Only supported in
text-embedding-3
and later models.
-
encodingFormat
final EmbeddingCreateParams.Body.Builder encodingFormat(EmbeddingCreateParams.EncodingFormat encodingFormat)
The format to return the embeddings in. Can be either
float
orbase64
.
-
encodingFormat
final EmbeddingCreateParams.Body.Builder encodingFormat(JsonField<EmbeddingCreateParams.EncodingFormat> encodingFormat)
The format to return the embeddings in. Can be either
float
orbase64
.
-
user
final EmbeddingCreateParams.Body.Builder user(String user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
user
final EmbeddingCreateParams.Body.Builder user(JsonField<String> user)
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
additionalProperties
final EmbeddingCreateParams.Body.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
putAdditionalProperty
final EmbeddingCreateParams.Body.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final EmbeddingCreateParams.Body.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final EmbeddingCreateParams.Body.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final EmbeddingCreateParams.Body.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final EmbeddingCreateParams.Body build()
-
-
-
-