Class: Telnyx::Resources::AI::Chat
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Chat
- Defined in:
- lib/telnyx/resources/ai/chat.rb,
sig/telnyx/resources/ai/chat.rbs
Overview
Generate text with LLMs
Instance Method Summary collapse
- #create_completion(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, response_format: nil, seed: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil, request_options: {}) ⇒ Hash{Symbol=>Object} deprecated Deprecated.
-
#initialize(client:) ⇒ Chat
constructor
private
A new instance of Chat.
Constructor Details
#initialize(client:) ⇒ Chat
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 Chat.
91 92 93 |
# File 'lib/telnyx/resources/ai/chat.rb', line 91 def initialize(client:) @client = client end |
Instance Method Details
#create_completion(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, response_format: nil, seed: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil, request_options: {}) ⇒ Hash{Symbol=>Object}
Deprecated.
Some parameter documentations has been truncated, see Models::AI::ChatCreateCompletionParams for more details.
Deprecated: Use POST /v2/ai/openai/chat/completions instead. Chat with a
language model. This endpoint is consistent with the
OpenAI Chat Completions API
and may be used with the OpenAI JS or Python SDK.
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/telnyx/resources/ai/chat.rb', line 77 def create_completion(params) parsed, = Telnyx::AI::ChatCreateCompletionParams.dump_request(params) @client.request( method: :post, path: "ai/chat/completions", body: parsed, model: Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown], options: ) end |