Class EmbeddingCreateParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class EmbeddingCreateParams implements Params
Creates an embedding vector representing the input text.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classEmbeddingCreateParams.Bodypublic final classEmbeddingCreateParams.BuilderA builder for EmbeddingCreateParams.
public final classEmbeddingCreateParams.InputInput 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.public final classEmbeddingCreateParams.EncodingFormatThe format to return the embeddings in. Can be either
floatorbase64.
-
Method Summary
Modifier and Type Method Description final EmbeddingCreateParams.Inputinput()Input text to embed, encoded as a string or array of tokens. final EmbeddingModelmodel()ID of the model to use. final Optional<Long>dimensions()The number of dimensions the resulting output embeddings should have. final Optional<EmbeddingCreateParams.EncodingFormat>encodingFormat()The format to return the embeddings in. final Optional<String>user()A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final JsonField<EmbeddingCreateParams.Input>_input()Input text to embed, encoded as a string or array of tokens. final JsonField<EmbeddingModel>_model()ID of the model to use. final JsonField<Long>_dimensions()The number of dimensions the resulting output embeddings should have. final JsonField<EmbeddingCreateParams.EncodingFormat>_encodingFormat()The format to return the embeddings in. final JsonField<String>_user()A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()final QueryParams_additionalQueryParams()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. final EmbeddingCreateParams.BuildertoBuilder()Booleanequals(Object other)IntegerhashCode()StringtoString()final static EmbeddingCreateParams.Builderbuilder()Returns a mutable builder for constructing an instance of EmbeddingCreateParams. -
-
Method Detail
-
input
final 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.
-
model
final 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.
-
dimensions
final Optional<Long> dimensions()
The number of dimensions the resulting output embeddings should have. Only supported in
text-embedding-3and later models.
-
encodingFormat
final Optional<EmbeddingCreateParams.EncodingFormat> encodingFormat()
The format to return the embeddings in. Can be either
floatorbase64.
-
user
final Optional<String> user()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
_input
final 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.
-
_model
final 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.
-
_dimensions
final JsonField<Long> _dimensions()
The number of dimensions the resulting output embeddings should have. Only supported in
text-embedding-3and later models.
-
_encodingFormat
final JsonField<EmbeddingCreateParams.EncodingFormat> _encodingFormat()
The format to return the embeddings in. Can be either
floatorbase64.
-
_user
final JsonField<String> _user()
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. Learn more.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
toBuilder
final EmbeddingCreateParams.Builder toBuilder()
-
builder
final static EmbeddingCreateParams.Builder builder()
Returns a mutable builder for constructing an instance of EmbeddingCreateParams.
The following fields are required:
.input() .model()
-
-
-
-