Class: Telnyx::Resources::AI::Anthropic::V1
- Inherits:
-
Object
- Object
- Telnyx::Resources::AI::Anthropic::V1
- Defined in:
- lib/telnyx/resources/ai/anthropic/v1.rb,
sig/telnyx/resources/ai/anthropic/v1.rbs
Instance Method Summary collapse
-
#initialize(client:) ⇒ V1
constructor
private
A new instance of V1.
-
#messages(max_tokens:, messages:, model:, api_key_ref: nil, billing_group_id: nil, fallback_config: nil, max_retries: nil, mcp_servers: nil, metadata: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, timeout: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {}) ⇒ Hash{Symbol=>Object}
Some parameter documentations has been truncated, see Models::AI::Anthropic::V1MessagesParams for more details.
Constructor Details
#initialize(client:) ⇒ V1
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 V1.
84 85 86 |
# File 'lib/telnyx/resources/ai/anthropic/v1.rb', line 84 def initialize(client:) @client = client end |
Instance Method Details
#messages(max_tokens:, messages:, model:, api_key_ref: nil, billing_group_id: nil, fallback_config: nil, max_retries: nil, mcp_servers: nil, metadata: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, timeout: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {}) ⇒ Hash{Symbol=>Object}
Some parameter documentations has been truncated, see Models::AI::Anthropic::V1MessagesParams for more details.
Send a message to a language model using the Anthropic Messages API format. This
endpoint is compatible with the
Anthropic Messages API and may be
used with the Anthropic JS or Python SDK by setting the base URL to
https://api.telnyx.com/v2/ai/anthropic.
The endpoint translates Anthropic-format requests into Telnyx's inference
internals, then translates the response back to the Anthropic message shape.
Streaming responses use Anthropic SSE event types (message_start,
content_block_start, content_block_delta, content_block_stop,
message_delta, message_stop).
70 71 72 73 74 75 76 77 78 79 |
# File 'lib/telnyx/resources/ai/anthropic/v1.rb', line 70 def (params) parsed, = Telnyx::AI::Anthropic::V1MessagesParams.dump_request(params) @client.request( method: :post, path: "ai/anthropic/v1/messages", body: parsed, model: Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown], options: ) end |