telnyx 5.166.0 → 5.168.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +1 -1
- data/lib/telnyx/client.rb +4 -0
- data/lib/telnyx/internal/default_flat_pagination.rb +7 -3
- data/lib/telnyx/internal/default_flat_pagination_for_inexplicit_number_orders.rb +7 -3
- data/lib/telnyx/internal/default_flat_pagination_top_level_array.rb +10 -8
- data/lib/telnyx/internal/default_pagination_for_log_messages.rb +7 -3
- data/lib/telnyx/internal/default_pagination_for_messaging_tollfree.rb +12 -3
- data/lib/telnyx/internal/default_pagination_for_queues.rb +12 -3
- data/lib/telnyx/internal/per_page_pagination.rb +8 -1
- data/lib/telnyx/internal/per_page_pagination_v2.rb +8 -1
- data/lib/telnyx/internal/type/converter.rb +2 -0
- data/lib/telnyx/models/ai/anthropic/v1_messages_params.rb +57 -1
- data/lib/telnyx/models/ai/assistant_a2_a_agent.rb +195 -0
- data/lib/telnyx/models/ai/assistant_create_params.rb +16 -1
- data/lib/telnyx/models/ai/assistant_update_params.rb +17 -1
- data/lib/telnyx/models/ai/assistants/update_assistant.rb +17 -1
- data/lib/telnyx/models/ai/chat_completion_request.rb +185 -48
- data/lib/telnyx/models/ai/inference_embedding.rb +16 -1
- data/lib/telnyx/models/ai/openai_create_response_params.rb +57 -1
- data/lib/telnyx/models/ai/telephony_settings.rb +15 -1
- data/lib/telnyx/models/compute/func_retrieve_logs_params.rb +66 -0
- data/lib/telnyx/models/compute/func_retrieve_logs_response.rb +161 -0
- data/lib/telnyx/models/compute/func_retrieve_metric_aggregates_params.rb +69 -0
- data/lib/telnyx/models/compute/func_retrieve_metric_aggregates_response.rb +137 -0
- data/lib/telnyx/models/compute/func_retrieve_revisions_params.rb +34 -0
- data/lib/telnyx/models/compute/func_retrieve_revisions_response.rb +101 -0
- data/lib/telnyx/models/compute/func_retrieve_ship_inspection_params.rb +22 -0
- data/lib/telnyx/models/compute/func_retrieve_ship_inspection_response.rb +94 -0
- data/lib/telnyx/models/compute/functions_observability_pagination_meta.rb +35 -0
- data/lib/telnyx/models/compute/logs_meta.rb +23 -0
- data/lib/telnyx/models/credential_connection.rb +4 -1
- data/lib/telnyx/models/email_inboxes/email_message.rb +12 -1
- data/lib/telnyx/models/email_message_batch_params.rb +4 -1
- data/lib/telnyx/models/email_message_batch_response.rb +1 -0
- data/lib/telnyx/models/fqdn_connection.rb +5 -2
- data/lib/telnyx/models/fqdn_connections/fqdn_authentication.rb +9 -2
- data/lib/telnyx/models/messaging_inbound_message_payload.rb +210 -67
- data/lib/telnyx/models/messaging_messaging_profile.rb +284 -0
- data/lib/telnyx/models/messaging_profile.rb +0 -1
- data/lib/telnyx/models/messaging_profile_create_params.rb +11 -1
- data/lib/telnyx/models/messaging_profile_create_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_delete_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_features.rb +26 -0
- data/lib/telnyx/models/messaging_profile_retrieve_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_update_params.rb +32 -1
- data/lib/telnyx/models/messaging_profile_update_response.rb +3 -3
- data/lib/telnyx/models/messaging_profiles/action_regenerate_secret_response.rb +3 -3
- data/lib/telnyx/models/uac_connection.rb +4 -1
- data/lib/telnyx/models/uac_external_settings.rb +6 -2
- data/lib/telnyx/models/unsafe_unwrap_webhook_event.rb +5 -1
- data/lib/telnyx/models/unwrap_webhook_event.rb +5 -1
- data/lib/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rb +104 -1
- data/lib/telnyx/models/whatsapp/phone_number_get_response.rb +103 -1
- data/lib/telnyx/models/whatsapp/phone_number_list_response.rb +103 -1
- data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rb +22 -0
- data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rb +207 -0
- data/lib/telnyx/models/whatsapp_account_update.rb +112 -0
- data/lib/telnyx/models/whatsapp_message_echo.rb +340 -0
- data/lib/telnyx/models/x402/credit_account/payment_list_params.rb +34 -0
- data/lib/telnyx/models/x402/credit_account/payment_retrieve_params.rb +24 -0
- data/lib/telnyx/models/x402/credit_account/payment_retrieve_response.rb +21 -0
- data/lib/telnyx/models/x402/credit_account/x402_transaction_record.rb +113 -0
- data/lib/telnyx/models.rb +10 -0
- data/lib/telnyx/resources/ai/anthropic/v1.rb +5 -1
- data/lib/telnyx/resources/ai/assistants/versions.rb +3 -1
- data/lib/telnyx/resources/ai/assistants.rb +6 -2
- data/lib/telnyx/resources/ai/openai/chat.rb +6 -8
- data/lib/telnyx/resources/ai/openai.rb +5 -1
- data/lib/telnyx/resources/compute/funcs.rb +141 -0
- data/lib/telnyx/resources/compute.rb +18 -0
- data/lib/telnyx/resources/email_messages.rb +4 -2
- data/lib/telnyx/resources/messaging_profiles.rb +12 -4
- data/lib/telnyx/resources/webhooks.rb +2 -2
- data/lib/telnyx/resources/whatsapp/phone_numbers.rb +22 -0
- data/lib/telnyx/resources/x402/credit_account/payments.rb +71 -0
- data/lib/telnyx/resources/x402/credit_account.rb +8 -2
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +24 -0
- data/rbi/telnyx/client.rbi +3 -0
- data/rbi/telnyx/models/ai/anthropic/v1_messages_params.rbi +139 -0
- data/rbi/telnyx/models/ai/assistant_a2_a_agent.rbi +345 -0
- data/rbi/telnyx/models/ai/assistant_create_params.rbi +29 -0
- data/rbi/telnyx/models/ai/assistant_update_params.rbi +31 -0
- data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +31 -0
- data/rbi/telnyx/models/ai/chat_completion_request.rbi +339 -91
- data/rbi/telnyx/models/ai/inference_embedding.rbi +29 -0
- data/rbi/telnyx/models/ai/openai_create_response_params.rbi +136 -0
- data/rbi/telnyx/models/ai/telephony_settings.rbi +23 -0
- data/rbi/telnyx/models/compute/func_retrieve_logs_params.rbi +130 -0
- data/rbi/telnyx/models/compute/func_retrieve_logs_response.rbi +410 -0
- data/rbi/telnyx/models/compute/func_retrieve_metric_aggregates_params.rbi +102 -0
- data/rbi/telnyx/models/compute/func_retrieve_metric_aggregates_response.rbi +231 -0
- data/rbi/telnyx/models/compute/func_retrieve_revisions_params.rbi +59 -0
- data/rbi/telnyx/models/compute/func_retrieve_revisions_response.rbi +213 -0
- data/rbi/telnyx/models/compute/func_retrieve_ship_inspection_params.rbi +40 -0
- data/rbi/telnyx/models/compute/func_retrieve_ship_inspection_response.rbi +252 -0
- data/rbi/telnyx/models/compute/functions_observability_pagination_meta.rbi +70 -0
- data/rbi/telnyx/models/compute/logs_meta.rbi +38 -0
- data/rbi/telnyx/models/credential_connection.rbi +8 -2
- data/rbi/telnyx/models/email_inboxes/email_message.rbi +22 -3
- data/rbi/telnyx/models/email_message_batch_params.rbi +6 -0
- data/rbi/telnyx/models/email_message_batch_response.rbi +5 -0
- data/rbi/telnyx/models/fqdn_connection.rbi +8 -2
- data/rbi/telnyx/models/fqdn_connections/fqdn_authentication.rbi +8 -2
- data/rbi/telnyx/models/messaging_inbound_message_payload.rbi +450 -193
- data/rbi/telnyx/models/messaging_messaging_profile.rbi +463 -0
- data/rbi/telnyx/models/messaging_profile.rbi +4 -6
- data/rbi/telnyx/models/messaging_profile_create_params.rbi +19 -0
- data/rbi/telnyx/models/messaging_profile_create_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_delete_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_features.rbi +43 -0
- data/rbi/telnyx/models/messaging_profile_retrieve_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_update_params.rbi +51 -0
- data/rbi/telnyx/models/messaging_profile_update_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbi +4 -4
- data/rbi/telnyx/models/uac_connection.rbi +8 -2
- data/rbi/telnyx/models/uac_external_settings.rbi +10 -2
- data/rbi/telnyx/models/unsafe_unwrap_webhook_event.rbi +3 -1
- data/rbi/telnyx/models/unwrap_webhook_event.rbi +3 -1
- data/rbi/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbi +213 -0
- data/rbi/telnyx/models/whatsapp/phone_number_get_response.rbi +213 -0
- data/rbi/telnyx/models/whatsapp/phone_number_list_response.rbi +213 -0
- data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rbi +40 -0
- data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbi +401 -0
- data/rbi/telnyx/models/whatsapp_account_update.rbi +236 -0
- data/rbi/telnyx/models/whatsapp_message_echo.rbi +611 -0
- data/rbi/telnyx/models/x402/credit_account/payment_list_params.rbi +64 -0
- data/rbi/telnyx/models/x402/credit_account/payment_retrieve_params.rbi +42 -0
- data/rbi/telnyx/models/x402/credit_account/payment_retrieve_response.rbi +53 -0
- data/rbi/telnyx/models/x402/credit_account/x402_transaction_record.rbi +219 -0
- data/rbi/telnyx/models.rbi +10 -0
- data/rbi/telnyx/resources/ai/anthropic/v1.rbi +14 -0
- data/rbi/telnyx/resources/ai/assistants/versions.rbi +12 -0
- data/rbi/telnyx/resources/ai/assistants.rbi +21 -0
- data/rbi/telnyx/resources/ai/openai/chat.rbi +23 -13
- data/rbi/telnyx/resources/ai/openai.rbi +14 -0
- data/rbi/telnyx/resources/compute/funcs.rbi +111 -0
- data/rbi/telnyx/resources/compute.rbi +15 -0
- data/rbi/telnyx/resources/email_messages.rbi +6 -2
- data/rbi/telnyx/resources/messaging_profiles.rbi +24 -1
- data/rbi/telnyx/resources/webhooks.rbi +6 -2
- data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +18 -0
- data/rbi/telnyx/resources/x402/credit_account/payments.rbi +60 -0
- data/rbi/telnyx/resources/x402/credit_account.rbi +5 -0
- data/sig/telnyx/client.rbs +2 -0
- data/sig/telnyx/models/ai/anthropic/v1_messages_params.rbs +42 -0
- data/sig/telnyx/models/ai/assistant_a2_a_agent.rbs +140 -0
- data/sig/telnyx/models/ai/assistant_create_params.rbs +9 -0
- data/sig/telnyx/models/ai/assistant_update_params.rbs +9 -0
- data/sig/telnyx/models/ai/assistants/update_assistant.rbs +9 -0
- data/sig/telnyx/models/ai/chat_completion_request.rbs +128 -44
- data/sig/telnyx/models/ai/inference_embedding.rbs +9 -0
- data/sig/telnyx/models/ai/openai_create_response_params.rbs +42 -0
- data/sig/telnyx/models/ai/telephony_settings.rbs +7 -0
- data/sig/telnyx/models/compute/func_retrieve_logs_params.rbs +69 -0
- data/sig/telnyx/models/compute/func_retrieve_logs_response.rbs +210 -0
- data/sig/telnyx/models/compute/func_retrieve_metric_aggregates_params.rbs +66 -0
- data/sig/telnyx/models/compute/func_retrieve_metric_aggregates_response.rbs +149 -0
- data/sig/telnyx/models/compute/func_retrieve_revisions_params.rbs +38 -0
- data/sig/telnyx/models/compute/func_retrieve_revisions_response.rbs +131 -0
- data/sig/telnyx/models/compute/func_retrieve_ship_inspection_params.rbs +22 -0
- data/sig/telnyx/models/compute/func_retrieve_ship_inspection_response.rbs +117 -0
- data/sig/telnyx/models/compute/functions_observability_pagination_meta.rbs +45 -0
- data/sig/telnyx/models/compute/logs_meta.rbs +21 -0
- data/sig/telnyx/models/email_inboxes/email_message.rbs +12 -3
- data/sig/telnyx/models/email_message_batch_response.rbs +2 -0
- data/sig/telnyx/models/messaging_inbound_message_payload.rbs +207 -95
- data/sig/telnyx/models/messaging_messaging_profile.rbs +212 -0
- data/sig/telnyx/models/messaging_profile_create_params.rbs +5 -0
- data/sig/telnyx/models/messaging_profile_create_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profile_delete_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profile_features.rbs +15 -0
- data/sig/telnyx/models/messaging_profile_retrieve_response.rbs +7 -5
- data/sig/telnyx/models/messaging_profile_update_params.rbs +19 -0
- data/sig/telnyx/models/messaging_profile_update_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbs +7 -5
- data/sig/telnyx/models/unsafe_unwrap_webhook_event.rbs +2 -0
- data/sig/telnyx/models/unwrap_webhook_event.rbs +2 -0
- data/sig/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbs +90 -0
- data/sig/telnyx/models/whatsapp/phone_number_get_response.rbs +90 -0
- data/sig/telnyx/models/whatsapp/phone_number_list_response.rbs +90 -0
- data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_params.rbs +25 -0
- data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbs +201 -0
- data/sig/telnyx/models/whatsapp_account_update.rbs +107 -0
- data/sig/telnyx/models/whatsapp_message_echo.rbs +291 -0
- data/sig/telnyx/models/x402/credit_account/payment_list_params.rbs +36 -0
- data/sig/telnyx/models/x402/credit_account/payment_retrieve_params.rbs +27 -0
- data/sig/telnyx/models/x402/credit_account/payment_retrieve_response.rbs +26 -0
- data/sig/telnyx/models/x402/credit_account/x402_transaction_record.rbs +104 -0
- data/sig/telnyx/models.rbs +10 -0
- data/sig/telnyx/resources/ai/anthropic/v1.rbs +2 -0
- data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -0
- data/sig/telnyx/resources/ai/assistants.rbs +2 -0
- data/sig/telnyx/resources/ai/openai/chat.rbs +3 -4
- data/sig/telnyx/resources/ai/openai.rbs +2 -0
- data/sig/telnyx/resources/compute/funcs.rbs +41 -0
- data/sig/telnyx/resources/compute.rbs +9 -0
- data/sig/telnyx/resources/messaging_profiles.rbs +5 -1
- data/sig/telnyx/resources/webhooks.rbs +6 -2
- data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +5 -0
- data/sig/telnyx/resources/x402/credit_account/payments.rbs +22 -0
- data/sig/telnyx/resources/x402/credit_account.rbs +2 -0
- metadata +74 -2
|
@@ -15,6 +15,25 @@ module Telnyx
|
|
|
15
15
|
sig { returns(String) }
|
|
16
16
|
attr_accessor :assistant_id
|
|
17
17
|
|
|
18
|
+
# A2A agents this assistant can delegate to. Tools are not stored here: at the
|
|
19
|
+
# start of every conversation each agent's card is fetched and one tool is derived
|
|
20
|
+
# per skill the card advertises, named `a2a_<name>_<skill_id>`. The following
|
|
21
|
+
# limits are not enforced when the assistant is saved, and anything past them is
|
|
22
|
+
# dropped when the conversation starts: 64 agents per assistant, 64 skills per
|
|
23
|
+
# card, 128 derived tools per assistant, and a 6 second budget for all card
|
|
24
|
+
# fetches combined. An agent whose card cannot be fetched costs the assistant that
|
|
25
|
+
# capability for the conversation; it does not fail the call. Omit this field to
|
|
26
|
+
# leave the assistant's agents unchanged; send an empty array to remove them all.
|
|
27
|
+
sig { returns(T.nilable(T::Array[Telnyx::AI::AssistantA2AAgent])) }
|
|
28
|
+
attr_reader :a2a_agents
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent::OrHash]
|
|
33
|
+
).void
|
|
34
|
+
end
|
|
35
|
+
attr_writer :a2a_agents
|
|
36
|
+
|
|
18
37
|
# Conversation flow as supplied by API clients (create / update).
|
|
19
38
|
#
|
|
20
39
|
# A directed graph of `FlowNodeReq` connected by `FlowEdge`s. Validation enforces
|
|
@@ -353,6 +372,7 @@ module Telnyx
|
|
|
353
372
|
sig do
|
|
354
373
|
params(
|
|
355
374
|
assistant_id: String,
|
|
375
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent::OrHash],
|
|
356
376
|
conversation_flow: Telnyx::AI::ConversationFlowReq::OrHash,
|
|
357
377
|
description: String,
|
|
358
378
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
@@ -407,6 +427,16 @@ module Telnyx
|
|
|
407
427
|
end
|
|
408
428
|
def self.new(
|
|
409
429
|
assistant_id:,
|
|
430
|
+
# A2A agents this assistant can delegate to. Tools are not stored here: at the
|
|
431
|
+
# start of every conversation each agent's card is fetched and one tool is derived
|
|
432
|
+
# per skill the card advertises, named `a2a_<name>_<skill_id>`. The following
|
|
433
|
+
# limits are not enforced when the assistant is saved, and anything past them is
|
|
434
|
+
# dropped when the conversation starts: 64 agents per assistant, 64 skills per
|
|
435
|
+
# card, 128 derived tools per assistant, and a 6 second budget for all card
|
|
436
|
+
# fetches combined. An agent whose card cannot be fetched costs the assistant that
|
|
437
|
+
# capability for the conversation; it does not fail the call. Omit this field to
|
|
438
|
+
# leave the assistant's agents unchanged; send an empty array to remove them all.
|
|
439
|
+
a2a_agents: nil,
|
|
410
440
|
# Conversation flow as supplied by API clients (create / update).
|
|
411
441
|
#
|
|
412
442
|
# A directed graph of `FlowNodeReq` connected by `FlowEdge`s. Validation enforces
|
|
@@ -511,6 +541,7 @@ module Telnyx
|
|
|
511
541
|
override.returns(
|
|
512
542
|
{
|
|
513
543
|
assistant_id: String,
|
|
544
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent],
|
|
514
545
|
conversation_flow: Telnyx::AI::ConversationFlowReq,
|
|
515
546
|
description: String,
|
|
516
547
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
@@ -15,6 +15,25 @@ module Telnyx
|
|
|
15
15
|
)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
# A2A agents this assistant can delegate to. Tools are not stored here: at the
|
|
19
|
+
# start of every conversation each agent's card is fetched and one tool is derived
|
|
20
|
+
# per skill the card advertises, named `a2a_<name>_<skill_id>`. The following
|
|
21
|
+
# limits are not enforced when the assistant is saved, and anything past them is
|
|
22
|
+
# dropped when the conversation starts: 64 agents per assistant, 64 skills per
|
|
23
|
+
# card, 128 derived tools per assistant, and a 6 second budget for all card
|
|
24
|
+
# fetches combined. An agent whose card cannot be fetched costs the assistant that
|
|
25
|
+
# capability for the conversation; it does not fail the call. Omit this field to
|
|
26
|
+
# leave the assistant's agents unchanged; send an empty array to remove them all.
|
|
27
|
+
sig { returns(T.nilable(T::Array[Telnyx::AI::AssistantA2AAgent])) }
|
|
28
|
+
attr_reader :a2a_agents
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
params(
|
|
32
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent::OrHash]
|
|
33
|
+
).void
|
|
34
|
+
end
|
|
35
|
+
attr_writer :a2a_agents
|
|
36
|
+
|
|
18
37
|
# Conversation flow as supplied by API clients (create / update).
|
|
19
38
|
#
|
|
20
39
|
# A directed graph of `FlowNodeReq` connected by `FlowEdge`s. Validation enforces
|
|
@@ -354,6 +373,7 @@ module Telnyx
|
|
|
354
373
|
|
|
355
374
|
sig do
|
|
356
375
|
params(
|
|
376
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent::OrHash],
|
|
357
377
|
conversation_flow: Telnyx::AI::ConversationFlowReq::OrHash,
|
|
358
378
|
description: String,
|
|
359
379
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
@@ -405,6 +425,16 @@ module Telnyx
|
|
|
405
425
|
).returns(T.attached_class)
|
|
406
426
|
end
|
|
407
427
|
def self.new(
|
|
428
|
+
# A2A agents this assistant can delegate to. Tools are not stored here: at the
|
|
429
|
+
# start of every conversation each agent's card is fetched and one tool is derived
|
|
430
|
+
# per skill the card advertises, named `a2a_<name>_<skill_id>`. The following
|
|
431
|
+
# limits are not enforced when the assistant is saved, and anything past them is
|
|
432
|
+
# dropped when the conversation starts: 64 agents per assistant, 64 skills per
|
|
433
|
+
# card, 128 derived tools per assistant, and a 6 second budget for all card
|
|
434
|
+
# fetches combined. An agent whose card cannot be fetched costs the assistant that
|
|
435
|
+
# capability for the conversation; it does not fail the call. Omit this field to
|
|
436
|
+
# leave the assistant's agents unchanged; send an empty array to remove them all.
|
|
437
|
+
a2a_agents: nil,
|
|
408
438
|
# Conversation flow as supplied by API clients (create / update).
|
|
409
439
|
#
|
|
410
440
|
# A directed graph of `FlowNodeReq` connected by `FlowEdge`s. Validation enforces
|
|
@@ -504,6 +534,7 @@ module Telnyx
|
|
|
504
534
|
sig do
|
|
505
535
|
override.returns(
|
|
506
536
|
{
|
|
537
|
+
a2a_agents: T::Array[Telnyx::AI::AssistantA2AAgent],
|
|
507
538
|
conversation_flow: Telnyx::AI::ConversationFlowReq,
|
|
508
539
|
description: String,
|
|
509
540
|
dynamic_variables: T::Hash[Symbol, T.anything],
|
|
@@ -56,28 +56,6 @@ module Telnyx
|
|
|
56
56
|
sig { params(frequency_penalty: Float).void }
|
|
57
57
|
attr_writer :frequency_penalty
|
|
58
58
|
|
|
59
|
-
# If specified, the output will be exactly one of the choices.
|
|
60
|
-
sig { returns(T.nilable(T::Array[String])) }
|
|
61
|
-
attr_reader :guided_choice
|
|
62
|
-
|
|
63
|
-
sig { params(guided_choice: T::Array[String]).void }
|
|
64
|
-
attr_writer :guided_choice
|
|
65
|
-
|
|
66
|
-
# Must be a valid JSON schema. If specified, the output will follow the JSON
|
|
67
|
-
# schema.
|
|
68
|
-
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
69
|
-
attr_reader :guided_json
|
|
70
|
-
|
|
71
|
-
sig { params(guided_json: T::Hash[Symbol, T.anything]).void }
|
|
72
|
-
attr_writer :guided_json
|
|
73
|
-
|
|
74
|
-
# If specified, the output will follow the regex pattern.
|
|
75
|
-
sig { returns(T.nilable(String)) }
|
|
76
|
-
attr_reader :guided_regex
|
|
77
|
-
|
|
78
|
-
sig { params(guided_regex: String).void }
|
|
79
|
-
attr_writer :guided_regex
|
|
80
|
-
|
|
81
59
|
# This is used with `use_beam_search` to prefer shorter or longer completions.
|
|
82
60
|
sig { returns(T.nilable(Float)) }
|
|
83
61
|
attr_reader :length_penalty
|
|
@@ -110,6 +88,21 @@ module Telnyx
|
|
|
110
88
|
sig { params(min_p: Float).void }
|
|
111
89
|
attr_writer :min_p
|
|
112
90
|
|
|
91
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
92
|
+
# tries that region first and falls back to another when the model cannot be
|
|
93
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
94
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
95
|
+
# redirected to another region. Requires `region`.
|
|
96
|
+
sig do
|
|
97
|
+
returns(T.nilable(Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol))
|
|
98
|
+
end
|
|
99
|
+
attr_reader :mode
|
|
100
|
+
|
|
101
|
+
sig do
|
|
102
|
+
params(mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol).void
|
|
103
|
+
end
|
|
104
|
+
attr_writer :mode
|
|
105
|
+
|
|
113
106
|
# The language model to chat with.
|
|
114
107
|
sig { returns(T.nilable(String)) }
|
|
115
108
|
attr_reader :model
|
|
@@ -153,17 +146,50 @@ module Telnyx
|
|
|
153
146
|
end
|
|
154
147
|
attr_writer :reasoning_effort
|
|
155
148
|
|
|
156
|
-
#
|
|
157
|
-
#
|
|
149
|
+
# Optional data-residency region the request should be served from, using the same
|
|
150
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
151
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
152
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
153
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
158
154
|
sig do
|
|
159
|
-
returns(
|
|
155
|
+
returns(
|
|
156
|
+
T.nilable(Telnyx::AI::ChatCompletionRequest::Region::OrSymbol)
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
attr_reader :region
|
|
160
|
+
|
|
161
|
+
sig do
|
|
162
|
+
params(
|
|
163
|
+
region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol
|
|
164
|
+
).void
|
|
165
|
+
end
|
|
166
|
+
attr_writer :region
|
|
167
|
+
|
|
168
|
+
# Controls the format of the model output. `json_object` guarantees valid JSON
|
|
169
|
+
# output without defining a schema; `json_schema` constrains the output to the
|
|
170
|
+
# JSON schema you supply via the `json_schema` property and is the supported way
|
|
171
|
+
# to get guaranteed structured output on Telnyx-hosted models.
|
|
172
|
+
sig do
|
|
173
|
+
returns(
|
|
174
|
+
T.nilable(
|
|
175
|
+
T.any(
|
|
176
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText,
|
|
177
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject,
|
|
178
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam
|
|
179
|
+
)
|
|
180
|
+
)
|
|
181
|
+
)
|
|
160
182
|
end
|
|
161
183
|
attr_reader :response_format
|
|
162
184
|
|
|
163
185
|
sig do
|
|
164
186
|
params(
|
|
165
187
|
response_format:
|
|
166
|
-
|
|
188
|
+
T.any(
|
|
189
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText::OrHash,
|
|
190
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject::OrHash,
|
|
191
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::OrHash
|
|
192
|
+
)
|
|
167
193
|
).void
|
|
168
194
|
end
|
|
169
195
|
attr_writer :response_format
|
|
@@ -295,20 +321,23 @@ module Telnyx
|
|
|
295
321
|
early_stopping: T::Boolean,
|
|
296
322
|
enable_thinking: T::Boolean,
|
|
297
323
|
frequency_penalty: Float,
|
|
298
|
-
guided_choice: T::Array[String],
|
|
299
|
-
guided_json: T::Hash[Symbol, T.anything],
|
|
300
|
-
guided_regex: String,
|
|
301
324
|
length_penalty: Float,
|
|
302
325
|
logprobs: T::Boolean,
|
|
303
326
|
max_tokens: Integer,
|
|
304
327
|
min_p: Float,
|
|
328
|
+
mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol,
|
|
305
329
|
model: String,
|
|
306
330
|
n: Float,
|
|
307
331
|
presence_penalty: Float,
|
|
308
332
|
reasoning_effort:
|
|
309
333
|
Telnyx::AI::ChatCompletionRequest::ReasoningEffort::OrSymbol,
|
|
334
|
+
region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol,
|
|
310
335
|
response_format:
|
|
311
|
-
|
|
336
|
+
T.any(
|
|
337
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText::OrHash,
|
|
338
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject::OrHash,
|
|
339
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::OrHash
|
|
340
|
+
),
|
|
312
341
|
seed: Integer,
|
|
313
342
|
service_tier: String,
|
|
314
343
|
stop: Telnyx::AI::ChatCompletionRequest::Stop::Variants,
|
|
@@ -349,13 +378,6 @@ module Telnyx
|
|
|
349
378
|
enable_thinking: nil,
|
|
350
379
|
# Higher values will penalize the model from repeating the same output tokens.
|
|
351
380
|
frequency_penalty: nil,
|
|
352
|
-
# If specified, the output will be exactly one of the choices.
|
|
353
|
-
guided_choice: nil,
|
|
354
|
-
# Must be a valid JSON schema. If specified, the output will follow the JSON
|
|
355
|
-
# schema.
|
|
356
|
-
guided_json: nil,
|
|
357
|
-
# If specified, the output will follow the regex pattern.
|
|
358
|
-
guided_regex: nil,
|
|
359
381
|
# This is used with `use_beam_search` to prefer shorter or longer completions.
|
|
360
382
|
length_penalty: nil,
|
|
361
383
|
# Whether to return log probabilities of the output tokens or not. If true,
|
|
@@ -368,6 +390,12 @@ module Telnyx
|
|
|
368
390
|
# [many prefer](https://github.com/huggingface/transformers/issues/27670). Must be
|
|
369
391
|
# in [0, 1].
|
|
370
392
|
min_p: nil,
|
|
393
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
394
|
+
# tries that region first and falls back to another when the model cannot be
|
|
395
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
396
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
397
|
+
# redirected to another region. Requires `region`.
|
|
398
|
+
mode: nil,
|
|
371
399
|
# The language model to chat with.
|
|
372
400
|
model: nil,
|
|
373
401
|
# This will return multiple choices for you instead of a single chat completion.
|
|
@@ -380,8 +408,16 @@ module Telnyx
|
|
|
380
408
|
# all models support all values; unsupported values are rejected with a 400 error.
|
|
381
409
|
# When omitted, reasoning models use their default effort level.
|
|
382
410
|
reasoning_effort: nil,
|
|
383
|
-
#
|
|
384
|
-
#
|
|
411
|
+
# Optional data-residency region the request should be served from, using the same
|
|
412
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
413
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
414
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
415
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
416
|
+
region: nil,
|
|
417
|
+
# Controls the format of the model output. `json_object` guarantees valid JSON
|
|
418
|
+
# output without defining a schema; `json_schema` constrains the output to the
|
|
419
|
+
# JSON schema you supply via the `json_schema` property and is the supported way
|
|
420
|
+
# to get guaranteed structured output on Telnyx-hosted models.
|
|
385
421
|
response_format: nil,
|
|
386
422
|
# If specified, the system will make a best effort to sample deterministically,
|
|
387
423
|
# such that repeated requests with the same `seed` and parameters should return
|
|
@@ -430,20 +466,23 @@ module Telnyx
|
|
|
430
466
|
early_stopping: T::Boolean,
|
|
431
467
|
enable_thinking: T::Boolean,
|
|
432
468
|
frequency_penalty: Float,
|
|
433
|
-
guided_choice: T::Array[String],
|
|
434
|
-
guided_json: T::Hash[Symbol, T.anything],
|
|
435
|
-
guided_regex: String,
|
|
436
469
|
length_penalty: Float,
|
|
437
470
|
logprobs: T::Boolean,
|
|
438
471
|
max_tokens: Integer,
|
|
439
472
|
min_p: Float,
|
|
473
|
+
mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol,
|
|
440
474
|
model: String,
|
|
441
475
|
n: Float,
|
|
442
476
|
presence_penalty: Float,
|
|
443
477
|
reasoning_effort:
|
|
444
478
|
Telnyx::AI::ChatCompletionRequest::ReasoningEffort::OrSymbol,
|
|
479
|
+
region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol,
|
|
445
480
|
response_format:
|
|
446
|
-
|
|
481
|
+
T.any(
|
|
482
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText,
|
|
483
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject,
|
|
484
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam
|
|
485
|
+
),
|
|
447
486
|
seed: Integer,
|
|
448
487
|
service_tier: String,
|
|
449
488
|
stop: Telnyx::AI::ChatCompletionRequest::Stop::Variants,
|
|
@@ -671,6 +710,40 @@ module Telnyx
|
|
|
671
710
|
end
|
|
672
711
|
end
|
|
673
712
|
|
|
713
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
714
|
+
# tries that region first and falls back to another when the model cannot be
|
|
715
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
716
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
717
|
+
# redirected to another region. Requires `region`.
|
|
718
|
+
module Mode
|
|
719
|
+
extend Telnyx::Internal::Type::Enum
|
|
720
|
+
|
|
721
|
+
TaggedSymbol =
|
|
722
|
+
T.type_alias do
|
|
723
|
+
T.all(Symbol, Telnyx::AI::ChatCompletionRequest::Mode)
|
|
724
|
+
end
|
|
725
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
726
|
+
|
|
727
|
+
PREFERRED =
|
|
728
|
+
T.let(
|
|
729
|
+
:preferred,
|
|
730
|
+
Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol
|
|
731
|
+
)
|
|
732
|
+
STRICT =
|
|
733
|
+
T.let(
|
|
734
|
+
:strict,
|
|
735
|
+
Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
sig do
|
|
739
|
+
override.returns(
|
|
740
|
+
T::Array[Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol]
|
|
741
|
+
)
|
|
742
|
+
end
|
|
743
|
+
def self.values
|
|
744
|
+
end
|
|
745
|
+
end
|
|
746
|
+
|
|
674
747
|
# Controls the reasoning effort for models that support it. When set, the model
|
|
675
748
|
# spends more or less compute on internal reasoning before generating its
|
|
676
749
|
# response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
|
|
@@ -732,77 +805,252 @@ module Telnyx
|
|
|
732
805
|
end
|
|
733
806
|
end
|
|
734
807
|
|
|
735
|
-
|
|
736
|
-
|
|
808
|
+
# Optional data-residency region the request should be served from, using the same
|
|
809
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
810
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
811
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
812
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
813
|
+
module Region
|
|
814
|
+
extend Telnyx::Internal::Type::Enum
|
|
815
|
+
|
|
816
|
+
TaggedSymbol =
|
|
737
817
|
T.type_alias do
|
|
738
|
-
T.
|
|
739
|
-
Telnyx::AI::ChatCompletionRequest::ResponseFormat,
|
|
740
|
-
Telnyx::Internal::AnyHash
|
|
741
|
-
)
|
|
818
|
+
T.all(Symbol, Telnyx::AI::ChatCompletionRequest::Region)
|
|
742
819
|
end
|
|
820
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
743
821
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
)
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
# control over the schema, use `guided_json`.
|
|
753
|
-
sig do
|
|
754
|
-
params(
|
|
755
|
-
type:
|
|
756
|
-
Telnyx::AI::ChatCompletionRequest::ResponseFormat::Type::OrSymbol
|
|
757
|
-
).returns(T.attached_class)
|
|
758
|
-
end
|
|
759
|
-
def self.new(type:)
|
|
760
|
-
end
|
|
822
|
+
USA =
|
|
823
|
+
T.let(:USA, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
|
|
824
|
+
EU =
|
|
825
|
+
T.let(:EU, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
|
|
826
|
+
AUS =
|
|
827
|
+
T.let(:AUS, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
|
|
828
|
+
UAE =
|
|
829
|
+
T.let(:UAE, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
|
|
761
830
|
|
|
762
831
|
sig do
|
|
763
832
|
override.returns(
|
|
764
|
-
|
|
765
|
-
type:
|
|
766
|
-
Telnyx::AI::ChatCompletionRequest::ResponseFormat::Type::OrSymbol
|
|
767
|
-
}
|
|
833
|
+
T::Array[Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol]
|
|
768
834
|
)
|
|
769
835
|
end
|
|
770
|
-
def
|
|
836
|
+
def self.values
|
|
771
837
|
end
|
|
838
|
+
end
|
|
772
839
|
|
|
773
|
-
|
|
774
|
-
|
|
840
|
+
# Controls the format of the model output. `json_object` guarantees valid JSON
|
|
841
|
+
# output without defining a schema; `json_schema` constrains the output to the
|
|
842
|
+
# JSON schema you supply via the `json_schema` property and is the supported way
|
|
843
|
+
# to get guaranteed structured output on Telnyx-hosted models.
|
|
844
|
+
module ResponseFormat
|
|
845
|
+
extend Telnyx::Internal::Type::Union
|
|
775
846
|
|
|
776
|
-
|
|
847
|
+
Variants =
|
|
848
|
+
T.type_alias do
|
|
849
|
+
T.any(
|
|
850
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText,
|
|
851
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject,
|
|
852
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam
|
|
853
|
+
)
|
|
854
|
+
end
|
|
855
|
+
|
|
856
|
+
class ResponseFormatText < Telnyx::Internal::Type::BaseModel
|
|
857
|
+
OrHash =
|
|
777
858
|
T.type_alias do
|
|
778
|
-
T.
|
|
779
|
-
|
|
780
|
-
Telnyx::
|
|
859
|
+
T.any(
|
|
860
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatText,
|
|
861
|
+
Telnyx::Internal::AnyHash
|
|
781
862
|
)
|
|
782
863
|
end
|
|
783
|
-
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
784
864
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
865
|
+
sig { returns(Symbol) }
|
|
866
|
+
attr_accessor :type
|
|
867
|
+
|
|
868
|
+
# Plain text output.
|
|
869
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
|
870
|
+
def self.new(type: :text)
|
|
871
|
+
end
|
|
872
|
+
|
|
873
|
+
sig { override.returns({ type: Symbol }) }
|
|
874
|
+
def to_hash
|
|
875
|
+
end
|
|
876
|
+
end
|
|
877
|
+
|
|
878
|
+
class ResponseFormatJsonObject < Telnyx::Internal::Type::BaseModel
|
|
879
|
+
OrHash =
|
|
880
|
+
T.type_alias do
|
|
881
|
+
T.any(
|
|
882
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonObject,
|
|
883
|
+
Telnyx::Internal::AnyHash
|
|
884
|
+
)
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
sig { returns(Symbol) }
|
|
888
|
+
attr_accessor :type
|
|
889
|
+
|
|
890
|
+
# JSON mode: the model output is valid JSON, without a schema.
|
|
891
|
+
sig { params(type: Symbol).returns(T.attached_class) }
|
|
892
|
+
def self.new(type: :json_object)
|
|
893
|
+
end
|
|
894
|
+
|
|
895
|
+
sig { override.returns({ type: Symbol }) }
|
|
896
|
+
def to_hash
|
|
897
|
+
end
|
|
898
|
+
end
|
|
899
|
+
|
|
900
|
+
class ResponseFormatJsonSchemaParam < Telnyx::Internal::Type::BaseModel
|
|
901
|
+
OrHash =
|
|
902
|
+
T.type_alias do
|
|
903
|
+
T.any(
|
|
904
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam,
|
|
905
|
+
Telnyx::Internal::AnyHash
|
|
906
|
+
)
|
|
907
|
+
end
|
|
908
|
+
|
|
909
|
+
# The JSON schema configuration, required when `type` is `json_schema`. Matches
|
|
910
|
+
# the
|
|
911
|
+
# [OpenAI structured outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
912
|
+
# `json_schema` response format.
|
|
913
|
+
sig do
|
|
914
|
+
returns(
|
|
915
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::JsonSchema
|
|
794
916
|
)
|
|
917
|
+
end
|
|
918
|
+
attr_reader :json_schema
|
|
919
|
+
|
|
920
|
+
sig do
|
|
921
|
+
params(
|
|
922
|
+
json_schema:
|
|
923
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::JsonSchema::OrHash
|
|
924
|
+
).void
|
|
925
|
+
end
|
|
926
|
+
attr_writer :json_schema
|
|
927
|
+
|
|
928
|
+
sig { returns(Symbol) }
|
|
929
|
+
attr_accessor :type
|
|
930
|
+
|
|
931
|
+
# Structured output: the model output is constrained to the JSON schema supplied
|
|
932
|
+
# in `json_schema`.
|
|
933
|
+
sig do
|
|
934
|
+
params(
|
|
935
|
+
json_schema:
|
|
936
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::JsonSchema::OrHash,
|
|
937
|
+
type: Symbol
|
|
938
|
+
).returns(T.attached_class)
|
|
939
|
+
end
|
|
940
|
+
def self.new(
|
|
941
|
+
# The JSON schema configuration, required when `type` is `json_schema`. Matches
|
|
942
|
+
# the
|
|
943
|
+
# [OpenAI structured outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
944
|
+
# `json_schema` response format.
|
|
945
|
+
json_schema:,
|
|
946
|
+
type: :json_schema
|
|
947
|
+
)
|
|
948
|
+
end
|
|
795
949
|
|
|
796
950
|
sig do
|
|
797
951
|
override.returns(
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
952
|
+
{
|
|
953
|
+
json_schema:
|
|
954
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::JsonSchema,
|
|
955
|
+
type: Symbol
|
|
956
|
+
}
|
|
801
957
|
)
|
|
802
958
|
end
|
|
803
|
-
def
|
|
959
|
+
def to_hash
|
|
960
|
+
end
|
|
961
|
+
|
|
962
|
+
class JsonSchema < Telnyx::Internal::Type::BaseModel
|
|
963
|
+
OrHash =
|
|
964
|
+
T.type_alias do
|
|
965
|
+
T.any(
|
|
966
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::ResponseFormatJsonSchemaParam::JsonSchema,
|
|
967
|
+
Telnyx::Internal::AnyHash
|
|
968
|
+
)
|
|
969
|
+
end
|
|
970
|
+
|
|
971
|
+
# The name of the response format. Used for clarity only.
|
|
972
|
+
sig { returns(String) }
|
|
973
|
+
attr_accessor :name
|
|
974
|
+
|
|
975
|
+
# A description of what the response format is for, typically used to guide the
|
|
976
|
+
# model.
|
|
977
|
+
sig { returns(T.nilable(String)) }
|
|
978
|
+
attr_reader :description
|
|
979
|
+
|
|
980
|
+
sig { params(description: String).void }
|
|
981
|
+
attr_writer :description
|
|
982
|
+
|
|
983
|
+
# The JSON schema the model output must conform to. A valid
|
|
984
|
+
# [JSON Schema](https://json-schema.org) object, e.g. a Pydantic
|
|
985
|
+
# `model_json_schema()` export.
|
|
986
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
987
|
+
attr_reader :schema
|
|
988
|
+
|
|
989
|
+
sig { params(schema: T::Hash[Symbol, T.anything]).void }
|
|
990
|
+
attr_writer :schema
|
|
991
|
+
|
|
992
|
+
# Enables strict schema adherence when supported by the model. If the generated
|
|
993
|
+
# output does not match the provided schema, the request fails instead of
|
|
994
|
+
# returning non-conformant output.
|
|
995
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
996
|
+
attr_reader :strict
|
|
997
|
+
|
|
998
|
+
sig { params(strict: T::Boolean).void }
|
|
999
|
+
attr_writer :strict
|
|
1000
|
+
|
|
1001
|
+
# The JSON schema configuration, required when `type` is `json_schema`. Matches
|
|
1002
|
+
# the
|
|
1003
|
+
# [OpenAI structured outputs](https://platform.openai.com/docs/guides/structured-outputs)
|
|
1004
|
+
# `json_schema` response format.
|
|
1005
|
+
sig do
|
|
1006
|
+
params(
|
|
1007
|
+
name: String,
|
|
1008
|
+
description: String,
|
|
1009
|
+
schema: T::Hash[Symbol, T.anything],
|
|
1010
|
+
strict: T::Boolean
|
|
1011
|
+
).returns(T.attached_class)
|
|
1012
|
+
end
|
|
1013
|
+
def self.new(
|
|
1014
|
+
# The name of the response format. Used for clarity only.
|
|
1015
|
+
name:,
|
|
1016
|
+
# A description of what the response format is for, typically used to guide the
|
|
1017
|
+
# model.
|
|
1018
|
+
description: nil,
|
|
1019
|
+
# The JSON schema the model output must conform to. A valid
|
|
1020
|
+
# [JSON Schema](https://json-schema.org) object, e.g. a Pydantic
|
|
1021
|
+
# `model_json_schema()` export.
|
|
1022
|
+
schema: nil,
|
|
1023
|
+
# Enables strict schema adherence when supported by the model. If the generated
|
|
1024
|
+
# output does not match the provided schema, the request fails instead of
|
|
1025
|
+
# returning non-conformant output.
|
|
1026
|
+
strict: nil
|
|
1027
|
+
)
|
|
1028
|
+
end
|
|
1029
|
+
|
|
1030
|
+
sig do
|
|
1031
|
+
override.returns(
|
|
1032
|
+
{
|
|
1033
|
+
name: String,
|
|
1034
|
+
description: String,
|
|
1035
|
+
schema: T::Hash[Symbol, T.anything],
|
|
1036
|
+
strict: T::Boolean
|
|
1037
|
+
}
|
|
1038
|
+
)
|
|
1039
|
+
end
|
|
1040
|
+
def to_hash
|
|
1041
|
+
end
|
|
804
1042
|
end
|
|
805
1043
|
end
|
|
1044
|
+
|
|
1045
|
+
sig do
|
|
1046
|
+
override.returns(
|
|
1047
|
+
T::Array[
|
|
1048
|
+
Telnyx::AI::ChatCompletionRequest::ResponseFormat::Variants
|
|
1049
|
+
]
|
|
1050
|
+
)
|
|
1051
|
+
end
|
|
1052
|
+
def self.variants
|
|
1053
|
+
end
|
|
806
1054
|
end
|
|
807
1055
|
|
|
808
1056
|
# Up to 4 sequences where the API will stop generating further tokens. The
|