Class: OpenAI::Models::EmbeddingCreateParams
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::EmbeddingCreateParams
- Extended by:
- Internal::Type::RequestParameters::Converter
- Includes:
- Internal::Type::RequestParameters
- Defined in:
- lib/openai/models/embedding_create_params.rb
Overview
Defined Under Namespace
Modules: EncodingFormat, Input, Model
Instance Attribute Summary collapse
-
#dimensions ⇒ Integer?
The number of dimensions the resulting output embeddings should have.
-
#encoding_format ⇒ Symbol, ...
The format to return the embeddings in.
-
#input ⇒ String, ...
Input text to embed, encoded as a string or array of tokens.
-
#model ⇒ String, ...
ID of the model to use.
-
#user ⇒ String?
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
Attributes included from Internal::Type::RequestParameters
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input: , model: , dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ Object
constructor
Some parameter documentations has been truncated, see EmbeddingCreateParams for more details.
Methods included from Internal::Type::RequestParameters::Converter
Methods included from Internal::Type::RequestParameters
Methods inherited from Internal::Type::BaseModel
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, type_info
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(input: , model: , dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::EmbeddingCreateParams for more details.
|
# File 'lib/openai/models/embedding_create_params.rb', line 56
|
Instance Attribute Details
#dimensions ⇒ Integer?
The number of dimensions the resulting output embeddings should have. Only supported in ‘text-embedding-3` and later models.
39 |
# File 'lib/openai/models/embedding_create_params.rb', line 39 optional :dimensions, Integer |
#encoding_format ⇒ Symbol, ...
The format to return the embeddings in. Can be either ‘float` or [`base64`](pypi.org/project/pybase64/).
46 |
# File 'lib/openai/models/embedding_create_params.rb', line 46 optional :encoding_format, enum: -> { OpenAI::EmbeddingCreateParams::EncodingFormat } |
#input ⇒ String, ...
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](cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) 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.
22 |
# File 'lib/openai/models/embedding_create_params.rb', line 22 required :input, union: -> { OpenAI::EmbeddingCreateParams::Input } |
#model ⇒ String, ...
ID of the model to use. You can use the [List models](platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](platform.openai.com/docs/models) for descriptions of them.
32 |
# File 'lib/openai/models/embedding_create_params.rb', line 32 required :model, union: -> { OpenAI::EmbeddingCreateParams::Model } |
#user ⇒ String?
A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](platform.openai.com/docs/guides/safety-best-practices#end-user-ids).
54 |
# File 'lib/openai/models/embedding_create_params.rb', line 54 optional :user, String |
Class Method Details
.variants ⇒ Array(String, Symbol, OpenAI::Models::EmbeddingModel)
|
# File 'lib/openai/models/embedding_create_params.rb', line 122
|