Class EmbeddingCreateParams.Body.Builder
-
- All Implemented Interfaces:
public final class EmbeddingCreateParams.Body.Builder
A builder for Body.
-
-
Method Summary
-
-
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 all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. Example Python code for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request.
-
input
final EmbeddingCreateParams.Body.Builder input(JsonField<EmbeddingCreateParams.Input> input)
Sets Builder.input to an arbitrary JSON value.
You should usually call Builder.input with a well-typed Input value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
input
final EmbeddingCreateParams.Body.Builder input(String string)
Alias for calling input with
Input.ofString(string)
.
-
inputOfArrayOfStrings
final EmbeddingCreateParams.Body.Builder inputOfArrayOfStrings(List<String> arrayOfStrings)
Alias for calling input with
Input.ofArrayOfStrings(arrayOfStrings)
.
-
inputOfArrayOfTokens
final EmbeddingCreateParams.Body.Builder inputOfArrayOfTokens(List<Long> arrayOfTokens)
Alias for calling input with
Input.ofArrayOfTokens(arrayOfTokens)
.
-
inputOfArrayOfTokenArrays
final EmbeddingCreateParams.Body.Builder inputOfArrayOfTokenArrays(List<List<Long>> arrayOfTokenArrays)
Alias for calling input with
Input.ofArrayOfTokenArrays(arrayOfTokenArrays)
.
-
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)
Sets Builder.model to an arbitrary JSON value.
You should usually call Builder.model with a well-typed EmbeddingModel value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
model
final EmbeddingCreateParams.Body.Builder model(String value)
Sets model to an arbitrary String.
You should usually call model with a well-typed EmbeddingModel constant instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.dimensions to an arbitrary JSON value.
You should usually call Builder.dimensions with a well-typed Long value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.encodingFormat to an arbitrary JSON value.
You should usually call Builder.encodingFormat with a well-typed EncodingFormat value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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)
Sets Builder.user to an arbitrary JSON value.
You should usually call Builder.user with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
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()
Returns an immutable instance of Body.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.input() .model()
-
-
-
-