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 class
EmbeddingCreateParams.Body
public final class
EmbeddingCreateParams.Builder
A builder for EmbeddingCreateParams.
public final class
EmbeddingCreateParams.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.public final class
EmbeddingCreateParams.EncodingFormat
The format to return the embeddings in. Can be either
float
orbase64
.
-
Method Summary
Modifier and Type Method Description final EmbeddingCreateParams.Input
input()
Input text to embed, encoded as a string or array of tokens. final EmbeddingModel
model()
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.Builder
toBuilder()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static EmbeddingCreateParams.Builder
builder()
-
-
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-3
and later models.
-
encodingFormat
final Optional<EmbeddingCreateParams.EncodingFormat> encodingFormat()
The format to return the embeddings in. Can be either
float
orbase64
.
-
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-3
and later models.
-
_encodingFormat
final JsonField<EmbeddingCreateParams.EncodingFormat> _encodingFormat()
The format to return the embeddings in. Can be either
float
orbase64
.
-
_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()
-
-
-
-