telnyx 5.69.0 → 5.71.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 +50 -0
- data/README.md +1 -1
- data/lib/telnyx/internal/util.rb +3 -1
- data/lib/telnyx/models/ai/assistant.rb +6 -149
- data/lib/telnyx/models/ai/assistant_create_params.rb +3 -42
- data/lib/telnyx/models/ai/assistant_update_params.rb +3 -42
- data/lib/telnyx/models/ai/assistants/update_assistant.rb +3 -43
- data/lib/telnyx/models/ai/conversation_add_message_params.rb +4 -4
- data/lib/telnyx/models/ai/inference_embedding.rb +3 -43
- data/lib/telnyx/models/ai/observability.rb +46 -0
- data/lib/telnyx/models/ai/observability_req.rb +46 -0
- data/lib/telnyx/models/book_appointment_tool.rb +31 -0
- data/lib/telnyx/models/book_appointment_tool_params.rb +51 -0
- data/lib/telnyx/models/call_assistant_request.rb +176 -0
- data/lib/telnyx/models/call_control_bucket_ids.rb +23 -0
- data/lib/telnyx/models/call_control_retrieval_tool.rb +31 -0
- data/lib/telnyx/models/call_dial_params.rb +34 -1
- data/lib/telnyx/models/calls/action_answer_params.rb +11 -1
- data/lib/telnyx/models/calls/action_start_ai_assistant_params.rb +6 -39
- data/lib/telnyx/models/calls/action_transfer_params.rb +24 -1
- data/lib/telnyx/models/check_availability_tool.rb +31 -0
- data/lib/telnyx/models/check_availability_tool_params.rb +31 -0
- data/lib/telnyx/models/enterprise_create_params.rb +1 -1
- data/lib/telnyx/models/enterprise_public.rb +1 -1
- data/lib/telnyx/models/enterprise_update_params.rb +1 -1
- data/lib/telnyx/models/enterprises/reputation/{number_create_params.rb → number_associate_params.rb} +2 -2
- data/lib/telnyx/models/enterprises/reputation/{number_create_response.rb → number_associate_response.rb} +5 -5
- data/lib/telnyx/models/enterprises/reputation/{number_delete_params.rb → number_disassociate_params.rb} +2 -2
- data/lib/telnyx/models/enterprises/{reputation_list_params.rb → reputation_disable_params.rb} +2 -2
- data/lib/telnyx/models/enterprises/{reputation_create_params.rb → reputation_enable_params.rb} +6 -6
- data/lib/telnyx/models/enterprises/{reputation_create_response.rb → reputation_enable_response.rb} +2 -2
- data/lib/telnyx/models/enterprises/{reputation_delete_all_params.rb → reputation_retrieve_params.rb} +2 -2
- data/lib/telnyx/models/enterprises/{reputation_list_response.rb → reputation_retrieve_response.rb} +2 -2
- data/lib/telnyx/models/porting_orders/phone_number_block_list_params.rb +9 -9
- data/lib/telnyx/models/pronunciation_dict_alias_item.rb +51 -0
- data/lib/telnyx/models/pronunciation_dict_create_params.rb +5 -93
- data/lib/telnyx/models/pronunciation_dict_create_response.rb +3 -191
- data/lib/telnyx/models/pronunciation_dict_data.rb +101 -0
- data/lib/telnyx/models/pronunciation_dict_phoneme_item.rb +71 -0
- data/lib/telnyx/models/pronunciation_dict_retrieve_response.rb +3 -191
- data/lib/telnyx/models/pronunciation_dict_update_params.rb +5 -93
- data/lib/telnyx/models/pronunciation_dict_update_response.rb +3 -191
- data/lib/telnyx/models/texml/accounts/call_calls_params.rb +203 -191
- data/lib/telnyx/models/voice_clone_create_from_design_params.rb +3 -3
- data/lib/telnyx/models/voice_clone_create_from_upload_params.rb +371 -71
- data/lib/telnyx/models/voice_clone_create_params.rb +161 -51
- data/lib/telnyx/models/voice_clone_data.rb +51 -4
- data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rb +26 -0
- data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rb +54 -0
- data/lib/telnyx/models.rb +20 -0
- data/lib/telnyx/resources/ai/assistants/versions.rb +1 -1
- data/lib/telnyx/resources/ai/assistants.rb +2 -2
- data/lib/telnyx/resources/calls/actions.rb +7 -3
- data/lib/telnyx/resources/calls.rb +5 -1
- data/lib/telnyx/resources/enterprises/reputation/numbers.rb +42 -42
- data/lib/telnyx/resources/enterprises/reputation.rb +61 -61
- data/lib/telnyx/resources/pronunciation_dicts.rb +4 -4
- data/lib/telnyx/resources/texml/accounts/calls.rb +3 -3
- data/lib/telnyx/resources/voice_clones.rb +7 -27
- data/lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb +20 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +22 -9
- data/rbi/telnyx/models/ai/assistant.rbi +15 -329
- data/rbi/telnyx/models/ai/assistant_create_params.rbi +4 -121
- data/rbi/telnyx/models/ai/assistant_update_params.rbi +4 -121
- data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +4 -123
- data/rbi/telnyx/models/ai/conversation_add_message_params.rbi +5 -5
- data/rbi/telnyx/models/ai/inference_embedding.rbi +4 -123
- data/rbi/telnyx/models/ai/observability.rbi +90 -0
- data/rbi/telnyx/models/ai/observability_req.rbi +92 -0
- data/rbi/telnyx/models/book_appointment_tool.rbi +65 -0
- data/rbi/telnyx/models/book_appointment_tool_params.rbi +83 -0
- data/rbi/telnyx/models/call_assistant_request.rbi +322 -0
- data/rbi/telnyx/models/call_control_bucket_ids.rbi +42 -0
- data/rbi/telnyx/models/call_control_retrieval_tool.rbi +63 -0
- data/rbi/telnyx/models/call_dial_params.rbi +52 -0
- data/rbi/telnyx/models/calls/action_answer_params.rbi +15 -0
- data/rbi/telnyx/models/calls/action_start_ai_assistant_params.rbi +10 -77
- data/rbi/telnyx/models/calls/action_transfer_params.rbi +57 -0
- data/rbi/telnyx/models/check_availability_tool.rbi +67 -0
- data/rbi/telnyx/models/check_availability_tool_params.rbi +45 -0
- data/rbi/telnyx/models/enterprise_create_params.rbi +1 -1
- data/rbi/telnyx/models/enterprise_public.rbi +1 -1
- data/rbi/telnyx/models/enterprise_update_params.rbi +1 -1
- data/rbi/telnyx/models/enterprises/reputation/{number_create_params.rbi → number_associate_params.rbi} +2 -2
- data/rbi/telnyx/models/enterprises/reputation/{number_create_response.rbi → number_associate_response.rbi} +7 -7
- data/rbi/telnyx/models/enterprises/reputation/{number_delete_params.rbi → number_disassociate_params.rbi} +2 -2
- data/rbi/telnyx/models/enterprises/{reputation_list_params.rbi → reputation_disable_params.rbi} +2 -2
- data/rbi/telnyx/models/enterprises/{reputation_create_params.rbi → reputation_enable_params.rbi} +14 -14
- data/rbi/telnyx/models/enterprises/{reputation_create_response.rbi → reputation_enable_response.rbi} +2 -2
- data/rbi/telnyx/models/enterprises/{reputation_delete_all_params.rbi → reputation_retrieve_params.rbi} +2 -2
- data/rbi/telnyx/models/enterprises/{reputation_list_response.rbi → reputation_retrieve_response.rbi} +2 -2
- data/rbi/telnyx/models/porting_orders/phone_number_block_list_params.rbi +34 -34
- data/rbi/telnyx/models/pronunciation_dict_alias_item.rbi +79 -0
- data/rbi/telnyx/models/pronunciation_dict_create_params.rbi +8 -154
- data/rbi/telnyx/models/pronunciation_dict_create_response.rbi +6 -366
- data/rbi/telnyx/models/pronunciation_dict_data.rbi +186 -0
- data/rbi/telnyx/models/pronunciation_dict_phoneme_item.rbi +117 -0
- data/rbi/telnyx/models/pronunciation_dict_retrieve_response.rbi +6 -366
- data/rbi/telnyx/models/pronunciation_dict_update_params.rbi +10 -156
- data/rbi/telnyx/models/pronunciation_dict_update_response.rbi +6 -366
- data/rbi/telnyx/models/texml/accounts/call_calls_params.rbi +391 -403
- data/rbi/telnyx/models/voice_clone_create_from_design_params.rbi +10 -10
- data/rbi/telnyx/models/voice_clone_create_from_upload_params.rbi +711 -134
- data/rbi/telnyx/models/voice_clone_create_params.rbi +345 -79
- data/rbi/telnyx/models/voice_clone_data.rbi +77 -4
- data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbi +47 -0
- data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbi +118 -0
- data/rbi/telnyx/models.rbi +20 -0
- data/rbi/telnyx/resources/ai/assistants/versions.rbi +1 -2
- data/rbi/telnyx/resources/ai/assistants.rbi +2 -4
- data/rbi/telnyx/resources/calls/actions.rbi +14 -3
- data/rbi/telnyx/resources/calls.rbi +10 -0
- data/rbi/telnyx/resources/enterprises/reputation/numbers.rbi +34 -34
- data/rbi/telnyx/resources/enterprises/reputation.rbi +44 -44
- data/rbi/telnyx/resources/pronunciation_dicts.rbi +5 -7
- data/rbi/telnyx/resources/texml/accounts/calls.rbi +5 -5
- data/rbi/telnyx/resources/voice_clones.rbi +17 -41
- data/rbi/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbi +16 -0
- data/sig/telnyx/models/ai/assistant.rbs +3 -142
- data/sig/telnyx/models/ai/assistant_create_params.rbs +6 -59
- data/sig/telnyx/models/ai/assistant_update_params.rbs +6 -59
- data/sig/telnyx/models/ai/assistants/update_assistant.rbs +6 -59
- data/sig/telnyx/models/ai/conversation_add_message_params.rbs +5 -5
- data/sig/telnyx/models/ai/inference_embedding.rbs +6 -59
- data/sig/telnyx/models/ai/observability.rbs +58 -0
- data/sig/telnyx/models/ai/observability_req.rbs +58 -0
- data/sig/telnyx/models/book_appointment_tool.rbs +35 -0
- data/sig/telnyx/models/book_appointment_tool_params.rbs +39 -0
- data/sig/telnyx/models/call_assistant_request.rbs +132 -0
- data/sig/telnyx/models/call_control_bucket_ids.rbs +21 -0
- data/sig/telnyx/models/call_control_retrieval_tool.rbs +35 -0
- data/sig/telnyx/models/call_dial_params.rbs +29 -0
- data/sig/telnyx/models/calls/action_answer_params.rbs +9 -0
- data/sig/telnyx/models/calls/action_start_ai_assistant_params.rbs +6 -35
- data/sig/telnyx/models/calls/action_transfer_params.rbs +20 -0
- data/sig/telnyx/models/check_availability_tool.rbs +35 -0
- data/sig/telnyx/models/check_availability_tool_params.rbs +16 -0
- data/sig/telnyx/models/enterprise_create_params.rbs +1 -1
- data/sig/telnyx/models/enterprise_public.rbs +1 -1
- data/sig/telnyx/models/enterprise_update_params.rbs +1 -1
- data/sig/telnyx/models/enterprises/reputation/{number_create_params.rbs → number_associate_params.rbs} +2 -2
- data/sig/telnyx/models/enterprises/reputation/{number_create_response.rbs → number_associate_response.rbs} +8 -8
- data/sig/telnyx/models/enterprises/reputation/{number_delete_params.rbs → number_disassociate_params.rbs} +2 -2
- data/sig/telnyx/models/enterprises/{reputation_list_params.rbs → reputation_disable_params.rbs} +2 -2
- data/sig/telnyx/models/enterprises/{reputation_create_params.rbs → reputation_enable_params.rbs} +9 -9
- data/sig/telnyx/models/enterprises/{reputation_create_response.rbs → reputation_enable_response.rbs} +2 -2
- data/sig/telnyx/models/enterprises/{reputation_delete_all_params.rbs → reputation_retrieve_params.rbs} +2 -2
- data/sig/telnyx/models/enterprises/{reputation_list_response.rbs → reputation_retrieve_response.rbs} +2 -2
- data/sig/telnyx/models/porting_orders/phone_number_block_list_params.rbs +9 -9
- data/sig/telnyx/models/pronunciation_dict_alias_item.rbs +40 -0
- data/sig/telnyx/models/pronunciation_dict_create_params.rbs +2 -58
- data/sig/telnyx/models/pronunciation_dict_create_response.rbs +6 -155
- data/sig/telnyx/models/pronunciation_dict_data.rbs +88 -0
- data/sig/telnyx/models/pronunciation_dict_phoneme_item.rbs +55 -0
- data/sig/telnyx/models/pronunciation_dict_retrieve_response.rbs +6 -155
- data/sig/telnyx/models/pronunciation_dict_update_params.rbs +2 -58
- data/sig/telnyx/models/pronunciation_dict_update_response.rbs +6 -155
- data/sig/telnyx/models/texml/accounts/call_calls_params.rbs +317 -325
- data/sig/telnyx/models/voice_clone_create_from_design_params.rbs +7 -7
- data/sig/telnyx/models/voice_clone_create_from_upload_params.rbs +269 -56
- data/sig/telnyx/models/voice_clone_create_params.rbs +129 -44
- data/sig/telnyx/models/voice_clone_data.rbs +43 -0
- data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbs +30 -0
- data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbs +63 -0
- data/sig/telnyx/models.rbs +20 -0
- data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -1
- data/sig/telnyx/resources/ai/assistants.rbs +2 -2
- data/sig/telnyx/resources/calls/actions.rbs +3 -1
- data/sig/telnyx/resources/calls.rbs +2 -0
- data/sig/telnyx/resources/enterprises/reputation/numbers.rbs +7 -7
- data/sig/telnyx/resources/enterprises/reputation.rbs +8 -8
- data/sig/telnyx/resources/pronunciation_dicts.rbs +1 -1
- data/sig/telnyx/resources/texml/accounts/calls.rbs +1 -1
- data/sig/telnyx/resources/voice_clones.rbs +2 -12
- data/sig/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbs +5 -0
- metadata +68 -29
- data/lib/telnyx/models/pronunciation_dict_list_response.rb +0 -190
- data/rbi/telnyx/models/pronunciation_dict_list_response.rbi +0 -353
- data/sig/telnyx/models/pronunciation_dict_list_response.rbs +0 -144
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
class CallAssistantRequest < Telnyx::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Telnyx::CallAssistantRequest, Telnyx::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The identifier of the AI assistant to use.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :id
|
|
14
|
+
|
|
15
|
+
# Map of dynamic variables and their default values. Dynamic variables can be
|
|
16
|
+
# referenced in instructions, greeting, and tool definitions using the
|
|
17
|
+
# `{{variable_name}}` syntax. Call-control-agent automatically merges in
|
|
18
|
+
# `telnyx_call_*` variables (telnyx_call_to, telnyx_call_from,
|
|
19
|
+
# telnyx_conversation_channel, telnyx_agent_target, telnyx_end_user_target,
|
|
20
|
+
# telnyx_call_caller_id_name) and custom header variables.
|
|
21
|
+
sig do
|
|
22
|
+
returns(
|
|
23
|
+
T.nilable(
|
|
24
|
+
T::Hash[
|
|
25
|
+
Symbol,
|
|
26
|
+
Telnyx::CallAssistantRequest::DynamicVariable::Variants
|
|
27
|
+
]
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
attr_reader :dynamic_variables
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
dynamic_variables:
|
|
36
|
+
T::Hash[
|
|
37
|
+
Symbol,
|
|
38
|
+
Telnyx::CallAssistantRequest::DynamicVariable::Variants
|
|
39
|
+
]
|
|
40
|
+
).void
|
|
41
|
+
end
|
|
42
|
+
attr_writer :dynamic_variables
|
|
43
|
+
|
|
44
|
+
# External LLM configuration for bringing your own LLM endpoint.
|
|
45
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
46
|
+
attr_reader :external_llm
|
|
47
|
+
|
|
48
|
+
sig { params(external_llm: T::Hash[Symbol, T.anything]).void }
|
|
49
|
+
attr_writer :external_llm
|
|
50
|
+
|
|
51
|
+
# Fallback LLM configuration used when the primary LLM provider is unavailable.
|
|
52
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
53
|
+
attr_reader :fallback_config
|
|
54
|
+
|
|
55
|
+
sig { params(fallback_config: T::Hash[Symbol, T.anything]).void }
|
|
56
|
+
attr_writer :fallback_config
|
|
57
|
+
|
|
58
|
+
# Initial greeting text spoken when the assistant starts. Can be plain text for
|
|
59
|
+
# any voice or SSML for `AWS.Polly.<voice_id>` voices. There is a 3,000 character
|
|
60
|
+
# limit.
|
|
61
|
+
sig { returns(T.nilable(String)) }
|
|
62
|
+
attr_reader :greeting
|
|
63
|
+
|
|
64
|
+
sig { params(greeting: String).void }
|
|
65
|
+
attr_writer :greeting
|
|
66
|
+
|
|
67
|
+
# System instructions for the voice assistant. Can be templated with
|
|
68
|
+
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
69
|
+
# This will overwrite the instructions set in the assistant configuration.
|
|
70
|
+
sig { returns(T.nilable(String)) }
|
|
71
|
+
attr_reader :instructions
|
|
72
|
+
|
|
73
|
+
sig { params(instructions: String).void }
|
|
74
|
+
attr_writer :instructions
|
|
75
|
+
|
|
76
|
+
# Integration secret identifier for the LLM provider API key. Use this field to
|
|
77
|
+
# reference an
|
|
78
|
+
# [integration secret](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
|
|
79
|
+
# containing your LLM provider API key. Supports any LLM provider (OpenAI,
|
|
80
|
+
# Anthropic, etc.).
|
|
81
|
+
sig { returns(T.nilable(String)) }
|
|
82
|
+
attr_reader :llm_api_key_ref
|
|
83
|
+
|
|
84
|
+
sig { params(llm_api_key_ref: String).void }
|
|
85
|
+
attr_writer :llm_api_key_ref
|
|
86
|
+
|
|
87
|
+
# MCP (Model Context Protocol) server configurations for extending the assistant's
|
|
88
|
+
# capabilities with external tools and data sources.
|
|
89
|
+
sig { returns(T.nilable(T::Array[T::Hash[Symbol, T.anything]])) }
|
|
90
|
+
attr_reader :mcp_servers
|
|
91
|
+
|
|
92
|
+
sig { params(mcp_servers: T::Array[T::Hash[Symbol, T.anything]]).void }
|
|
93
|
+
attr_writer :mcp_servers
|
|
94
|
+
|
|
95
|
+
# LLM model override for this call. If omitted, the assistant's configured model
|
|
96
|
+
# is used.
|
|
97
|
+
sig { returns(T.nilable(String)) }
|
|
98
|
+
attr_reader :model
|
|
99
|
+
|
|
100
|
+
sig { params(model: String).void }
|
|
101
|
+
attr_writer :model
|
|
102
|
+
|
|
103
|
+
# Assistant name override for this call.
|
|
104
|
+
sig { returns(T.nilable(String)) }
|
|
105
|
+
attr_reader :name
|
|
106
|
+
|
|
107
|
+
sig { params(name: String).void }
|
|
108
|
+
attr_writer :name
|
|
109
|
+
|
|
110
|
+
# Observability configuration for the assistant session, including Langfuse
|
|
111
|
+
# integration for tracing and monitoring.
|
|
112
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
113
|
+
attr_reader :observability_settings
|
|
114
|
+
|
|
115
|
+
sig { params(observability_settings: T::Hash[Symbol, T.anything]).void }
|
|
116
|
+
attr_writer :observability_settings
|
|
117
|
+
|
|
118
|
+
# Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for
|
|
119
|
+
# the OpenAI API key. This field is maintained for backward compatibility;
|
|
120
|
+
# `llm_api_key_ref` is the canonical field name and supports all LLM providers.
|
|
121
|
+
sig { returns(T.nilable(String)) }
|
|
122
|
+
attr_reader :openai_api_key_ref
|
|
123
|
+
|
|
124
|
+
sig { params(openai_api_key_ref: String).void }
|
|
125
|
+
attr_writer :openai_api_key_ref
|
|
126
|
+
|
|
127
|
+
# Inline tool definitions available to the assistant (webhook, retrieval,
|
|
128
|
+
# transfer, hangup, etc.). Overrides the assistant's stored tools if provided.
|
|
129
|
+
sig do
|
|
130
|
+
returns(
|
|
131
|
+
T.nilable(
|
|
132
|
+
T::Array[
|
|
133
|
+
T.any(
|
|
134
|
+
Telnyx::BookAppointmentTool,
|
|
135
|
+
Telnyx::CheckAvailabilityTool,
|
|
136
|
+
Telnyx::AI::WebhookTool,
|
|
137
|
+
Telnyx::AI::HangupTool,
|
|
138
|
+
Telnyx::AI::TransferTool,
|
|
139
|
+
Telnyx::CallControlRetrievalTool
|
|
140
|
+
)
|
|
141
|
+
]
|
|
142
|
+
)
|
|
143
|
+
)
|
|
144
|
+
end
|
|
145
|
+
attr_reader :tools
|
|
146
|
+
|
|
147
|
+
sig do
|
|
148
|
+
params(
|
|
149
|
+
tools:
|
|
150
|
+
T::Array[
|
|
151
|
+
T.any(
|
|
152
|
+
Telnyx::BookAppointmentTool::OrHash,
|
|
153
|
+
Telnyx::CheckAvailabilityTool::OrHash,
|
|
154
|
+
Telnyx::AI::WebhookTool::OrHash,
|
|
155
|
+
Telnyx::AI::HangupTool::OrHash,
|
|
156
|
+
Telnyx::AI::TransferTool::OrHash,
|
|
157
|
+
Telnyx::CallControlRetrievalTool::OrHash
|
|
158
|
+
)
|
|
159
|
+
]
|
|
160
|
+
).void
|
|
161
|
+
end
|
|
162
|
+
attr_writer :tools
|
|
163
|
+
|
|
164
|
+
# AI Assistant configuration. All fields except `id` are optional — the
|
|
165
|
+
# assistant's stored configuration will be used as fallback for any omitted
|
|
166
|
+
# fields.
|
|
167
|
+
sig do
|
|
168
|
+
params(
|
|
169
|
+
id: String,
|
|
170
|
+
dynamic_variables:
|
|
171
|
+
T::Hash[
|
|
172
|
+
Symbol,
|
|
173
|
+
Telnyx::CallAssistantRequest::DynamicVariable::Variants
|
|
174
|
+
],
|
|
175
|
+
external_llm: T::Hash[Symbol, T.anything],
|
|
176
|
+
fallback_config: T::Hash[Symbol, T.anything],
|
|
177
|
+
greeting: String,
|
|
178
|
+
instructions: String,
|
|
179
|
+
llm_api_key_ref: String,
|
|
180
|
+
mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
|
|
181
|
+
model: String,
|
|
182
|
+
name: String,
|
|
183
|
+
observability_settings: T::Hash[Symbol, T.anything],
|
|
184
|
+
openai_api_key_ref: String,
|
|
185
|
+
tools:
|
|
186
|
+
T::Array[
|
|
187
|
+
T.any(
|
|
188
|
+
Telnyx::BookAppointmentTool::OrHash,
|
|
189
|
+
Telnyx::CheckAvailabilityTool::OrHash,
|
|
190
|
+
Telnyx::AI::WebhookTool::OrHash,
|
|
191
|
+
Telnyx::AI::HangupTool::OrHash,
|
|
192
|
+
Telnyx::AI::TransferTool::OrHash,
|
|
193
|
+
Telnyx::CallControlRetrievalTool::OrHash
|
|
194
|
+
)
|
|
195
|
+
]
|
|
196
|
+
).returns(T.attached_class)
|
|
197
|
+
end
|
|
198
|
+
def self.new(
|
|
199
|
+
# The identifier of the AI assistant to use.
|
|
200
|
+
id:,
|
|
201
|
+
# Map of dynamic variables and their default values. Dynamic variables can be
|
|
202
|
+
# referenced in instructions, greeting, and tool definitions using the
|
|
203
|
+
# `{{variable_name}}` syntax. Call-control-agent automatically merges in
|
|
204
|
+
# `telnyx_call_*` variables (telnyx_call_to, telnyx_call_from,
|
|
205
|
+
# telnyx_conversation_channel, telnyx_agent_target, telnyx_end_user_target,
|
|
206
|
+
# telnyx_call_caller_id_name) and custom header variables.
|
|
207
|
+
dynamic_variables: nil,
|
|
208
|
+
# External LLM configuration for bringing your own LLM endpoint.
|
|
209
|
+
external_llm: nil,
|
|
210
|
+
# Fallback LLM configuration used when the primary LLM provider is unavailable.
|
|
211
|
+
fallback_config: nil,
|
|
212
|
+
# Initial greeting text spoken when the assistant starts. Can be plain text for
|
|
213
|
+
# any voice or SSML for `AWS.Polly.<voice_id>` voices. There is a 3,000 character
|
|
214
|
+
# limit.
|
|
215
|
+
greeting: nil,
|
|
216
|
+
# System instructions for the voice assistant. Can be templated with
|
|
217
|
+
# [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
|
|
218
|
+
# This will overwrite the instructions set in the assistant configuration.
|
|
219
|
+
instructions: nil,
|
|
220
|
+
# Integration secret identifier for the LLM provider API key. Use this field to
|
|
221
|
+
# reference an
|
|
222
|
+
# [integration secret](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
|
|
223
|
+
# containing your LLM provider API key. Supports any LLM provider (OpenAI,
|
|
224
|
+
# Anthropic, etc.).
|
|
225
|
+
llm_api_key_ref: nil,
|
|
226
|
+
# MCP (Model Context Protocol) server configurations for extending the assistant's
|
|
227
|
+
# capabilities with external tools and data sources.
|
|
228
|
+
mcp_servers: nil,
|
|
229
|
+
# LLM model override for this call. If omitted, the assistant's configured model
|
|
230
|
+
# is used.
|
|
231
|
+
model: nil,
|
|
232
|
+
# Assistant name override for this call.
|
|
233
|
+
name: nil,
|
|
234
|
+
# Observability configuration for the assistant session, including Langfuse
|
|
235
|
+
# integration for tracing and monitoring.
|
|
236
|
+
observability_settings: nil,
|
|
237
|
+
# Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for
|
|
238
|
+
# the OpenAI API key. This field is maintained for backward compatibility;
|
|
239
|
+
# `llm_api_key_ref` is the canonical field name and supports all LLM providers.
|
|
240
|
+
openai_api_key_ref: nil,
|
|
241
|
+
# Inline tool definitions available to the assistant (webhook, retrieval,
|
|
242
|
+
# transfer, hangup, etc.). Overrides the assistant's stored tools if provided.
|
|
243
|
+
tools: nil
|
|
244
|
+
)
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
sig do
|
|
248
|
+
override.returns(
|
|
249
|
+
{
|
|
250
|
+
id: String,
|
|
251
|
+
dynamic_variables:
|
|
252
|
+
T::Hash[
|
|
253
|
+
Symbol,
|
|
254
|
+
Telnyx::CallAssistantRequest::DynamicVariable::Variants
|
|
255
|
+
],
|
|
256
|
+
external_llm: T::Hash[Symbol, T.anything],
|
|
257
|
+
fallback_config: T::Hash[Symbol, T.anything],
|
|
258
|
+
greeting: String,
|
|
259
|
+
instructions: String,
|
|
260
|
+
llm_api_key_ref: String,
|
|
261
|
+
mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
|
|
262
|
+
model: String,
|
|
263
|
+
name: String,
|
|
264
|
+
observability_settings: T::Hash[Symbol, T.anything],
|
|
265
|
+
openai_api_key_ref: String,
|
|
266
|
+
tools:
|
|
267
|
+
T::Array[
|
|
268
|
+
T.any(
|
|
269
|
+
Telnyx::BookAppointmentTool,
|
|
270
|
+
Telnyx::CheckAvailabilityTool,
|
|
271
|
+
Telnyx::AI::WebhookTool,
|
|
272
|
+
Telnyx::AI::HangupTool,
|
|
273
|
+
Telnyx::AI::TransferTool,
|
|
274
|
+
Telnyx::CallControlRetrievalTool
|
|
275
|
+
)
|
|
276
|
+
]
|
|
277
|
+
}
|
|
278
|
+
)
|
|
279
|
+
end
|
|
280
|
+
def to_hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
module DynamicVariable
|
|
284
|
+
extend Telnyx::Internal::Type::Union
|
|
285
|
+
|
|
286
|
+
Variants = T.type_alias { T.any(String, Float, T::Boolean) }
|
|
287
|
+
|
|
288
|
+
sig do
|
|
289
|
+
override.returns(
|
|
290
|
+
T::Array[Telnyx::CallAssistantRequest::DynamicVariable::Variants]
|
|
291
|
+
)
|
|
292
|
+
end
|
|
293
|
+
def self.variants
|
|
294
|
+
end
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
module Tool
|
|
298
|
+
extend Telnyx::Internal::Type::Union
|
|
299
|
+
|
|
300
|
+
Variants =
|
|
301
|
+
T.type_alias do
|
|
302
|
+
T.any(
|
|
303
|
+
Telnyx::BookAppointmentTool,
|
|
304
|
+
Telnyx::CheckAvailabilityTool,
|
|
305
|
+
Telnyx::AI::WebhookTool,
|
|
306
|
+
Telnyx::AI::HangupTool,
|
|
307
|
+
Telnyx::AI::TransferTool,
|
|
308
|
+
Telnyx::CallControlRetrievalTool
|
|
309
|
+
)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
sig do
|
|
313
|
+
override.returns(
|
|
314
|
+
T::Array[Telnyx::CallAssistantRequest::Tool::Variants]
|
|
315
|
+
)
|
|
316
|
+
end
|
|
317
|
+
def self.variants
|
|
318
|
+
end
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
end
|
|
322
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
class CallControlBucketIDs < Telnyx::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Telnyx::CallControlBucketIDs, Telnyx::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(T::Array[String]) }
|
|
12
|
+
attr_accessor :bucket_ids
|
|
13
|
+
|
|
14
|
+
# The maximum number of results to retrieve as context for the language model.
|
|
15
|
+
sig { returns(T.nilable(Integer)) }
|
|
16
|
+
attr_reader :max_num_results
|
|
17
|
+
|
|
18
|
+
sig { params(max_num_results: Integer).void }
|
|
19
|
+
attr_writer :max_num_results
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(bucket_ids: T::Array[String], max_num_results: Integer).returns(
|
|
23
|
+
T.attached_class
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
bucket_ids:,
|
|
28
|
+
# The maximum number of results to retrieve as context for the language model.
|
|
29
|
+
max_num_results: nil
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
sig do
|
|
34
|
+
override.returns(
|
|
35
|
+
{ bucket_ids: T::Array[String], max_num_results: Integer }
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
class CallControlRetrievalTool < Telnyx::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Telnyx::CallControlRetrievalTool, Telnyx::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(Telnyx::CallControlBucketIDs) }
|
|
12
|
+
attr_reader :retrieval
|
|
13
|
+
|
|
14
|
+
sig { params(retrieval: Telnyx::CallControlBucketIDs::OrHash).void }
|
|
15
|
+
attr_writer :retrieval
|
|
16
|
+
|
|
17
|
+
sig { returns(Telnyx::CallControlRetrievalTool::Type::OrSymbol) }
|
|
18
|
+
attr_accessor :type
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
retrieval: Telnyx::CallControlBucketIDs::OrHash,
|
|
23
|
+
type: Telnyx::CallControlRetrievalTool::Type::OrSymbol
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(retrieval:, type:)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{
|
|
32
|
+
retrieval: Telnyx::CallControlBucketIDs,
|
|
33
|
+
type: Telnyx::CallControlRetrievalTool::Type::OrSymbol
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
def to_hash
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
module Type
|
|
41
|
+
extend Telnyx::Internal::Type::Enum
|
|
42
|
+
|
|
43
|
+
TaggedSymbol =
|
|
44
|
+
T.type_alias { T.all(Symbol, Telnyx::CallControlRetrievalTool::Type) }
|
|
45
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
46
|
+
|
|
47
|
+
RETRIEVAL =
|
|
48
|
+
T.let(
|
|
49
|
+
:retrieval,
|
|
50
|
+
Telnyx::CallControlRetrievalTool::Type::TaggedSymbol
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
sig do
|
|
54
|
+
override.returns(
|
|
55
|
+
T::Array[Telnyx::CallControlRetrievalTool::Type::TaggedSymbol]
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
def self.values
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -75,6 +75,15 @@ module Telnyx
|
|
|
75
75
|
end
|
|
76
76
|
attr_writer :answering_machine_detection_config
|
|
77
77
|
|
|
78
|
+
# AI Assistant configuration. All fields except `id` are optional — the
|
|
79
|
+
# assistant's stored configuration will be used as fallback for any omitted
|
|
80
|
+
# fields.
|
|
81
|
+
sig { returns(T.nilable(Telnyx::CallAssistantRequest)) }
|
|
82
|
+
attr_reader :assistant
|
|
83
|
+
|
|
84
|
+
sig { params(assistant: Telnyx::CallAssistantRequest::OrHash).void }
|
|
85
|
+
attr_writer :assistant
|
|
86
|
+
|
|
78
87
|
# The URL of a file to be played back to the callee when the call is answered. The
|
|
79
88
|
# URL can point to either a WAV or MP3 file. media_name and audio_url cannot be
|
|
80
89
|
# used together in one request.
|
|
@@ -224,6 +233,15 @@ module Telnyx
|
|
|
224
233
|
sig { params(prevent_double_bridge: T::Boolean).void }
|
|
225
234
|
attr_writer :prevent_double_bridge
|
|
226
235
|
|
|
236
|
+
# Indicates the privacy level to be used for the call. When set to `id`, caller ID
|
|
237
|
+
# information (name and number) will be hidden from the called party. When set to
|
|
238
|
+
# `none` or omitted, caller ID will be shown normally.
|
|
239
|
+
sig { returns(T.nilable(Telnyx::CallDialParams::Privacy::OrSymbol)) }
|
|
240
|
+
attr_reader :privacy
|
|
241
|
+
|
|
242
|
+
sig { params(privacy: Telnyx::CallDialParams::Privacy::OrSymbol).void }
|
|
243
|
+
attr_writer :privacy
|
|
244
|
+
|
|
227
245
|
# Start recording automatically after an event. Disabled by default.
|
|
228
246
|
sig { returns(T.nilable(Telnyx::CallDialParams::Record::OrSymbol)) }
|
|
229
247
|
attr_reader :record
|
|
@@ -553,6 +571,7 @@ module Telnyx
|
|
|
553
571
|
Telnyx::CallDialParams::AnsweringMachineDetection::OrSymbol,
|
|
554
572
|
answering_machine_detection_config:
|
|
555
573
|
Telnyx::CallDialParams::AnsweringMachineDetectionConfig::OrHash,
|
|
574
|
+
assistant: Telnyx::CallAssistantRequest::OrHash,
|
|
556
575
|
audio_url: String,
|
|
557
576
|
billing_group_id: String,
|
|
558
577
|
bridge_intent: T::Boolean,
|
|
@@ -570,6 +589,7 @@ module Telnyx
|
|
|
570
589
|
park_after_unbridge: String,
|
|
571
590
|
preferred_codecs: String,
|
|
572
591
|
prevent_double_bridge: T::Boolean,
|
|
592
|
+
privacy: Telnyx::CallDialParams::Privacy::OrSymbol,
|
|
573
593
|
record: Telnyx::CallDialParams::Record::OrSymbol,
|
|
574
594
|
record_channels: Telnyx::CallDialParams::RecordChannels::OrSymbol,
|
|
575
595
|
record_custom_file_name: String,
|
|
@@ -642,6 +662,10 @@ module Telnyx
|
|
|
642
662
|
# Optional configuration parameters to modify 'answering_machine_detection'
|
|
643
663
|
# performance.
|
|
644
664
|
answering_machine_detection_config: nil,
|
|
665
|
+
# AI Assistant configuration. All fields except `id` are optional — the
|
|
666
|
+
# assistant's stored configuration will be used as fallback for any omitted
|
|
667
|
+
# fields.
|
|
668
|
+
assistant: nil,
|
|
645
669
|
# The URL of a file to be played back to the callee when the call is answered. The
|
|
646
670
|
# URL can point to either a WAV or MP3 file. media_name and audio_url cannot be
|
|
647
671
|
# used together in one request.
|
|
@@ -694,6 +718,10 @@ module Telnyx
|
|
|
694
718
|
# Prevents bridging and hangs up the call if the target is already bridged.
|
|
695
719
|
# Disabled by default.
|
|
696
720
|
prevent_double_bridge: nil,
|
|
721
|
+
# Indicates the privacy level to be used for the call. When set to `id`, caller ID
|
|
722
|
+
# information (name and number) will be hidden from the called party. When set to
|
|
723
|
+
# `none` or omitted, caller ID will be shown normally.
|
|
724
|
+
privacy: nil,
|
|
697
725
|
# Start recording automatically after an event. Disabled by default.
|
|
698
726
|
record: nil,
|
|
699
727
|
# Defines which channel should be recorded ('single' or 'dual') when `record` is
|
|
@@ -801,6 +829,7 @@ module Telnyx
|
|
|
801
829
|
Telnyx::CallDialParams::AnsweringMachineDetection::OrSymbol,
|
|
802
830
|
answering_machine_detection_config:
|
|
803
831
|
Telnyx::CallDialParams::AnsweringMachineDetectionConfig,
|
|
832
|
+
assistant: Telnyx::CallAssistantRequest,
|
|
804
833
|
audio_url: String,
|
|
805
834
|
billing_group_id: String,
|
|
806
835
|
bridge_intent: T::Boolean,
|
|
@@ -818,6 +847,7 @@ module Telnyx
|
|
|
818
847
|
park_after_unbridge: String,
|
|
819
848
|
preferred_codecs: String,
|
|
820
849
|
prevent_double_bridge: T::Boolean,
|
|
850
|
+
privacy: Telnyx::CallDialParams::Privacy::OrSymbol,
|
|
821
851
|
record: Telnyx::CallDialParams::Record::OrSymbol,
|
|
822
852
|
record_channels: Telnyx::CallDialParams::RecordChannels::OrSymbol,
|
|
823
853
|
record_custom_file_name: String,
|
|
@@ -1479,6 +1509,28 @@ module Telnyx
|
|
|
1479
1509
|
end
|
|
1480
1510
|
end
|
|
1481
1511
|
|
|
1512
|
+
# Indicates the privacy level to be used for the call. When set to `id`, caller ID
|
|
1513
|
+
# information (name and number) will be hidden from the called party. When set to
|
|
1514
|
+
# `none` or omitted, caller ID will be shown normally.
|
|
1515
|
+
module Privacy
|
|
1516
|
+
extend Telnyx::Internal::Type::Enum
|
|
1517
|
+
|
|
1518
|
+
TaggedSymbol =
|
|
1519
|
+
T.type_alias { T.all(Symbol, Telnyx::CallDialParams::Privacy) }
|
|
1520
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
1521
|
+
|
|
1522
|
+
ID = T.let(:id, Telnyx::CallDialParams::Privacy::TaggedSymbol)
|
|
1523
|
+
NONE = T.let(:none, Telnyx::CallDialParams::Privacy::TaggedSymbol)
|
|
1524
|
+
|
|
1525
|
+
sig do
|
|
1526
|
+
override.returns(
|
|
1527
|
+
T::Array[Telnyx::CallDialParams::Privacy::TaggedSymbol]
|
|
1528
|
+
)
|
|
1529
|
+
end
|
|
1530
|
+
def self.values
|
|
1531
|
+
end
|
|
1532
|
+
end
|
|
1533
|
+
|
|
1482
1534
|
# Start recording automatically after an event. Disabled by default.
|
|
1483
1535
|
module Record
|
|
1484
1536
|
extend Telnyx::Internal::Type::Enum
|
|
@@ -15,6 +15,15 @@ module Telnyx
|
|
|
15
15
|
sig { returns(String) }
|
|
16
16
|
attr_accessor :call_control_id
|
|
17
17
|
|
|
18
|
+
# AI Assistant configuration. All fields except `id` are optional — the
|
|
19
|
+
# assistant's stored configuration will be used as fallback for any omitted
|
|
20
|
+
# fields.
|
|
21
|
+
sig { returns(T.nilable(Telnyx::CallAssistantRequest)) }
|
|
22
|
+
attr_reader :assistant
|
|
23
|
+
|
|
24
|
+
sig { params(assistant: Telnyx::CallAssistantRequest::OrHash).void }
|
|
25
|
+
attr_writer :assistant
|
|
26
|
+
|
|
18
27
|
# Use this field to set the Billing Group ID for the call. Must be a valid and
|
|
19
28
|
# existing Billing Group ID.
|
|
20
29
|
sig { returns(T.nilable(String)) }
|
|
@@ -372,6 +381,7 @@ module Telnyx
|
|
|
372
381
|
sig do
|
|
373
382
|
params(
|
|
374
383
|
call_control_id: String,
|
|
384
|
+
assistant: Telnyx::CallAssistantRequest::OrHash,
|
|
375
385
|
billing_group_id: String,
|
|
376
386
|
client_state: String,
|
|
377
387
|
command_id: String,
|
|
@@ -422,6 +432,10 @@ module Telnyx
|
|
|
422
432
|
end
|
|
423
433
|
def self.new(
|
|
424
434
|
call_control_id:,
|
|
435
|
+
# AI Assistant configuration. All fields except `id` are optional — the
|
|
436
|
+
# assistant's stored configuration will be used as fallback for any omitted
|
|
437
|
+
# fields.
|
|
438
|
+
assistant: nil,
|
|
425
439
|
# Use this field to set the Billing Group ID for the call. Must be a valid and
|
|
426
440
|
# existing Billing Group ID.
|
|
427
441
|
billing_group_id: nil,
|
|
@@ -510,6 +524,7 @@ module Telnyx
|
|
|
510
524
|
override.returns(
|
|
511
525
|
{
|
|
512
526
|
call_control_id: String,
|
|
527
|
+
assistant: Telnyx::CallAssistantRequest,
|
|
513
528
|
billing_group_id: String,
|
|
514
529
|
client_state: String,
|
|
515
530
|
command_id: String,
|