Class: OpenAI::Resources::Embeddings
- Inherits:
-
Object
- Object
- OpenAI::Resources::Embeddings
- Defined in:
- lib/openai/resources/embeddings.rb
Instance Method Summary collapse
-
#create(input: , model: , dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ OpenAI::Models::CreateEmbeddingResponse
Some parameter documentations has been truncated, see Models::EmbeddingCreateParams for more details.
-
#initialize(client:) ⇒ Embeddings
constructor
private
A new instance of Embeddings.
Constructor Details
#initialize(client:) ⇒ Embeddings
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Embeddings.
42 43 44 |
# File 'lib/openai/resources/embeddings.rb', line 42 def initialize(client:) @client = client end |
Instance Method Details
#create(input: , model: , dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ OpenAI::Models::CreateEmbeddingResponse
Some parameter documentations has been truncated, see Models::EmbeddingCreateParams for more details.
Creates an embedding vector representing the input text.
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/openai/resources/embeddings.rb', line 28 def create(params) parsed, = OpenAI::EmbeddingCreateParams.dump_request(params) @client.request( method: :post, path: "embeddings", body: parsed, model: OpenAI::CreateEmbeddingResponse, options: ) end |