Class: Telnyx::Resources::AI::OpenAI::Embeddings
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::OpenAI::Embeddings
- Defined in:
- lib/telnyx/resources/ai/openai/embeddings.rb,
sig/telnyx/resources/ai/openai/embeddings.rbs
Overview
OpenAI-compatible embeddings endpoints for generating vector representations of text
Instance Method Summary collapse
-
#create_embeddings(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ Telnyx::Models::AI::OpenAI::EmbeddingCreateEmbeddingsResponse
Some parameter documentations has been truncated, see Models::AI::OpenAI::EmbeddingCreateEmbeddingsParams for more details.
-
#initialize(client:) ⇒ Embeddings
constructor
private
A new instance of Embeddings.
-
#list_embedding_models(request_options: {}) ⇒ Telnyx::Models::AI::OpenAI::EmbeddingListEmbeddingModelsResponse
Returns a list of available embedding models.
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.
69 70 71 |
# File 'lib/telnyx/resources/ai/openai/embeddings.rb', line 69 def initialize(client:) @client = client end |
Instance Method Details
#create_embeddings(input:, model:, dimensions: nil, encoding_format: nil, user: nil, request_options: {}) ⇒ Telnyx::Models::AI::OpenAI::EmbeddingCreateEmbeddingsResponse
Some parameter documentations has been truncated, see Models::AI::OpenAI::EmbeddingCreateEmbeddingsParams for more details.
Creates an embedding vector representing the input text. This endpoint is
compatible with the
OpenAI Embeddings API
and may be used with the OpenAI JS or Python SDK by setting the base URL to
https://api.telnyx.com/v2/ai/openai.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/telnyx/resources/ai/openai/embeddings.rb', line 36 def (params) parsed, = Telnyx::AI::OpenAI::EmbeddingCreateEmbeddingsParams.dump_request(params) @client.request( method: :post, path: "ai/openai/embeddings", body: parsed, model: Telnyx::Models::AI::OpenAI::EmbeddingCreateEmbeddingsResponse, options: ) end |
#list_embedding_models(request_options: {}) ⇒ Telnyx::Models::AI::OpenAI::EmbeddingListEmbeddingModelsResponse
Returns a list of available embedding models. This endpoint is compatible with the OpenAI Models API format.
57 58 59 60 61 62 63 64 |
# File 'lib/telnyx/resources/ai/openai/embeddings.rb', line 57 def (params = {}) @client.request( method: :get, path: "ai/openai/embeddings/models", model: Telnyx::Models::AI::OpenAI::EmbeddingListEmbeddingModelsResponse, options: params[:request_options] ) end |