Class: Telnyx::Resources::AI::OpenAI
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::OpenAI
- Defined in:
- lib/telnyx/resources/ai/openai.rb,
lib/telnyx/resources/ai/openai/chat.rb,
lib/telnyx/resources/ai/openai/embeddings.rb
Defined Under Namespace
Classes: Chat, Embeddings
Instance Attribute Summary collapse
- #chat ⇒ Telnyx::Resources::AI::OpenAI::Chat readonly
-
#embeddings ⇒ Telnyx::Resources::AI::OpenAI::Embeddings
readonly
OpenAI-compatible embeddings endpoints for generating vector representations of text.
Instance Method Summary collapse
-
#initialize(client:) ⇒ OpenAI
constructor
private
A new instance of OpenAI.
-
#list_models(request_options: {}) ⇒ Telnyx::Models::AI::OpenAIListModelsResponse
This endpoint returns a list of Open Source and OpenAI models that are available for use.
Constructor Details
#initialize(client:) ⇒ OpenAI
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 OpenAI.
40 41 42 43 44 |
# File 'lib/telnyx/resources/ai/openai.rb', line 40 def initialize(client:) @client = client @embeddings = Telnyx::Resources::AI::OpenAI::Embeddings.new(client: client) @chat = Telnyx::Resources::AI::OpenAI::Chat.new(client: client) end |
Instance Attribute Details
#chat ⇒ Telnyx::Resources::AI::OpenAI::Chat (readonly)
13 14 15 |
# File 'lib/telnyx/resources/ai/openai.rb', line 13 def chat @chat end |
#embeddings ⇒ Telnyx::Resources::AI::OpenAI::Embeddings (readonly)
OpenAI-compatible embeddings endpoints for generating vector representations of text
10 11 12 |
# File 'lib/telnyx/resources/ai/openai.rb', line 10 def @embeddings end |
Instance Method Details
#list_models(request_options: {}) ⇒ Telnyx::Models::AI::OpenAIListModelsResponse
This endpoint returns a list of Open Source and OpenAI models that are available for use. <br /><br /> Note: Model ‘id`’s will be in the form ‘source/model_name`. For example `openai/gpt-4` or `mistralai/Mistral-7B-Instruct-v0.1` consistent with HuggingFace naming conventions.
28 29 30 31 32 33 34 35 |
# File 'lib/telnyx/resources/ai/openai.rb', line 28 def list_models(params = {}) @client.request( method: :get, path: "ai/openai/models", model: Telnyx::Models::AI::OpenAIListModelsResponse, options: params[:request_options] ) end |