telnyx 5.123.0 → 5.124.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 +5 -0
- data/lib/telnyx/models/ai/assistant_create_params.rb +780 -1
- data/lib/telnyx/models/ai/assistant_update_params.rb +780 -1
- data/lib/telnyx/models/ai/assistants/update_assistant.rb +785 -1
- data/lib/telnyx/models/ai/inference_embedding.rb +767 -1
- data/lib/telnyx/models/{ai_create_response_params.rb → ai_create_response_deprecated_params.rb} +2 -2
- data/lib/telnyx/models/{ai_create_response_response.rb → ai_create_response_deprecated_response.rb} +1 -1
- data/lib/telnyx/models/call_dial_params.rb +276 -10
- data/lib/telnyx/models/calls/action_answer_params.rb +278 -10
- data/lib/telnyx/models/calls/action_gather_using_speak_params.rb +15 -4
- data/lib/telnyx/models/calls/action_speak_params.rb +15 -4
- data/lib/telnyx/models/calls/action_start_conversation_relay_params.rb +431 -13
- data/lib/telnyx/models/calls/transcription_start_request.rb +173 -5
- data/lib/telnyx/models/conferences/action_speak_params.rb +15 -4
- data/lib/telnyx/models/messaging_profile_update_params.rb +9 -1
- data/lib/telnyx/models/sip_registration_status_retrieve_params.rb +45 -0
- data/lib/telnyx/models/sip_registration_status_retrieve_response.rb +160 -0
- data/lib/telnyx/models/speech_to_text_list_providers_params.rb +16 -5
- data/lib/telnyx/models/speech_to_text_list_providers_response.rb +55 -23
- data/lib/telnyx/models/voice_sdk_call_report_list_response.rb +114 -9
- data/lib/telnyx/models/voice_sdk_call_report_retrieve_response.rb +116 -9
- data/lib/telnyx/models/whatsapp/user_data_retrieve_response.rb +44 -3
- data/lib/telnyx/models/whatsapp/user_data_update_response.rb +44 -3
- data/lib/telnyx/models.rb +3 -9
- data/lib/telnyx/resources/ai/assistants/versions.rb +3 -1
- data/lib/telnyx/resources/ai/assistants.rb +6 -2
- data/lib/telnyx/resources/ai.rb +4 -4
- data/lib/telnyx/resources/calls/actions.rb +6 -6
- data/lib/telnyx/resources/conferences/actions.rb +1 -1
- data/lib/telnyx/resources/messaging_profiles.rb +3 -1
- data/lib/telnyx/resources/sip_registration_status.rb +45 -0
- data/lib/telnyx/resources/speech_to_text.rb +6 -5
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +5 -9
- data/rbi/telnyx/client.rbi +4 -0
- data/rbi/telnyx/models/ai/assistant_create_params.rbi +1411 -0
- data/rbi/telnyx/models/ai/assistant_update_params.rbi +1411 -0
- data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +1417 -0
- data/rbi/telnyx/models/ai/inference_embedding.rbi +1454 -0
- data/rbi/telnyx/models/{ai_create_response_params.rbi → ai_create_response_deprecated_params.rbi} +5 -2
- data/rbi/telnyx/models/{ai_create_response_response.rbi → ai_create_response_deprecated_response.rbi} +1 -1
- data/rbi/telnyx/models/call_dial_params.rbi +661 -13
- data/rbi/telnyx/models/calls/action_answer_params.rbi +659 -13
- data/rbi/telnyx/models/calls/action_gather_using_speak_params.rbi +30 -5
- data/rbi/telnyx/models/calls/action_speak_params.rbi +30 -5
- data/rbi/telnyx/models/calls/action_start_conversation_relay_params.rbi +1016 -17
- data/rbi/telnyx/models/calls/transcription_start_request.rbi +433 -10
- data/rbi/telnyx/models/conferences/action_speak_params.rbi +30 -5
- data/rbi/telnyx/models/messaging_profile_update_params.rbi +8 -0
- data/rbi/telnyx/models/sip_registration_status_retrieve_params.rbi +93 -0
- data/rbi/telnyx/models/sip_registration_status_retrieve_response.rbi +343 -0
- data/rbi/telnyx/models/speech_to_text_list_providers_params.rbi +27 -7
- data/rbi/telnyx/models/speech_to_text_list_providers_response.rbi +107 -43
- data/rbi/telnyx/models/voice_sdk_call_report_list_response.rbi +294 -9
- data/rbi/telnyx/models/voice_sdk_call_report_retrieve_response.rbi +294 -9
- data/rbi/telnyx/models/whatsapp/user_data_retrieve_response.rbi +96 -6
- data/rbi/telnyx/models/whatsapp/user_data_update_response.rbi +94 -6
- data/rbi/telnyx/models.rbi +5 -10
- data/rbi/telnyx/resources/ai/assistants/versions.rbi +8 -0
- data/rbi/telnyx/resources/ai/assistants.rbi +16 -0
- data/rbi/telnyx/resources/ai.rbi +1 -1
- data/rbi/telnyx/resources/calls/actions.rbi +10 -7
- data/rbi/telnyx/resources/conferences/actions.rbi +1 -1
- data/rbi/telnyx/resources/messaging_profiles.rbi +3 -0
- data/rbi/telnyx/resources/sip_registration_status.rbi +34 -0
- data/rbi/telnyx/resources/speech_to_text.rbi +11 -5
- data/sig/telnyx/client.rbs +2 -0
- data/sig/telnyx/models/ai/assistant_create_params.rbs +508 -0
- data/sig/telnyx/models/ai/assistant_update_params.rbs +508 -0
- data/sig/telnyx/models/ai/assistants/update_assistant.rbs +511 -0
- data/sig/telnyx/models/ai/inference_embedding.rbs +526 -0
- data/sig/telnyx/models/{ai_create_response_params.rbs → ai_create_response_deprecated_params.rbs} +2 -2
- data/sig/telnyx/models/ai_create_response_deprecated_response.rbs +7 -0
- data/sig/telnyx/models/call_dial_params.rbs +236 -13
- data/sig/telnyx/models/calls/action_answer_params.rbs +236 -13
- data/sig/telnyx/models/calls/action_gather_using_speak_params.rbs +11 -1
- data/sig/telnyx/models/calls/action_speak_params.rbs +11 -1
- data/sig/telnyx/models/calls/action_start_conversation_relay_params.rbs +370 -19
- data/sig/telnyx/models/calls/transcription_start_request.rbs +175 -2
- data/sig/telnyx/models/conferences/action_speak_params.rbs +11 -1
- data/sig/telnyx/models/messaging_profile_update_params.rbs +5 -0
- data/sig/telnyx/models/sip_registration_status_retrieve_params.rbs +41 -0
- data/sig/telnyx/models/sip_registration_status_retrieve_response.rbs +164 -0
- data/sig/telnyx/models/speech_to_text_list_providers_params.rbs +4 -4
- data/sig/telnyx/models/speech_to_text_list_providers_response.rbs +33 -16
- data/sig/telnyx/models/voice_sdk_call_report_list_response.rbs +121 -8
- data/sig/telnyx/models/voice_sdk_call_report_retrieve_response.rbs +121 -8
- data/sig/telnyx/models/whatsapp/user_data_retrieve_response.rbs +57 -6
- data/sig/telnyx/models/whatsapp/user_data_update_response.rbs +57 -6
- data/sig/telnyx/models.rbs +3 -9
- data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -0
- data/sig/telnyx/resources/ai/assistants.rbs +2 -0
- data/sig/telnyx/resources/ai.rbs +2 -2
- data/sig/telnyx/resources/calls/actions.rbs +2 -2
- data/sig/telnyx/resources/messaging_profiles.rbs +1 -0
- data/sig/telnyx/resources/sip_registration_status.rbs +13 -0
- metadata +17 -29
- data/lib/telnyx/models/calls/transcription_engine_soniox_config.rb +0 -91
- data/lib/telnyx/models/calls/transcription_engine_speechmatics_config.rb +0 -100
- data/lib/telnyx/models/conversation_relay_interruption_settings.rb +0 -105
- data/lib/telnyx/models/conversation_relay_language.rb +0 -141
- data/lib/telnyx/models/inworld_voice_settings.rb +0 -28
- data/lib/telnyx/models/voice_sdk_call_report_log_entry.rb +0 -57
- data/lib/telnyx/models/whatsapp/whatsapp_user_data.rb +0 -49
- data/rbi/telnyx/models/calls/transcription_engine_soniox_config.rbi +0 -184
- data/rbi/telnyx/models/calls/transcription_engine_speechmatics_config.rbi +0 -289
- data/rbi/telnyx/models/conversation_relay_interruption_settings.rbi +0 -271
- data/rbi/telnyx/models/conversation_relay_language.rbi +0 -309
- data/rbi/telnyx/models/inworld_voice_settings.rbi +0 -53
- data/rbi/telnyx/models/voice_sdk_call_report_log_entry.rbi +0 -108
- data/rbi/telnyx/models/whatsapp/whatsapp_user_data.rbi +0 -82
- data/sig/telnyx/models/ai_create_response_response.rbs +0 -7
- data/sig/telnyx/models/calls/transcription_engine_soniox_config.rbs +0 -79
- data/sig/telnyx/models/calls/transcription_engine_speechmatics_config.rbs +0 -114
- data/sig/telnyx/models/conversation_relay_interruption_settings.rbs +0 -88
- data/sig/telnyx/models/conversation_relay_language.rbs +0 -121
- data/sig/telnyx/models/inworld_voice_settings.rbs +0 -26
- data/sig/telnyx/models/voice_sdk_call_report_log_entry.rbs +0 -58
- data/sig/telnyx/models/whatsapp/whatsapp_user_data.rbs +0 -54
|
@@ -37,6 +37,12 @@ module Telnyx
|
|
|
37
37
|
# @return [String]
|
|
38
38
|
required :name, String
|
|
39
39
|
|
|
40
|
+
# @!attribute conversation_flow
|
|
41
|
+
# Conversation flow as returned by the API.
|
|
42
|
+
#
|
|
43
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow, nil]
|
|
44
|
+
optional :conversation_flow, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow }
|
|
45
|
+
|
|
40
46
|
# @!attribute description
|
|
41
47
|
#
|
|
42
48
|
# @return [String, nil]
|
|
@@ -231,7 +237,7 @@ module Telnyx
|
|
|
231
237
|
# @return [Telnyx::Models::AI::WidgetSettings, nil]
|
|
232
238
|
optional :widget_settings, -> { Telnyx::AI::WidgetSettings }
|
|
233
239
|
|
|
234
|
-
# @!method initialize(id:, created_at:, instructions:, model:, name:, description: nil, dynamic_variables: nil, dynamic_variables_webhook_timeout_ms: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, external_llm: nil, fallback_config: nil, greeting: nil, import_metadata: nil, insight_settings: nil, integrations: nil, interruption_settings: nil, llm_api_key_ref: nil, mcp_servers: nil, messaging_settings: nil, observability_settings: nil, post_conversation_settings: nil, privacy_settings: nil, related_mission_ids: nil, tags: nil, telephony_settings: nil, tools: nil, transcription: nil, version_created_at: nil, version_id: nil, version_name: nil, voice_settings: nil, widget_settings: nil)
|
|
240
|
+
# @!method initialize(id:, created_at:, instructions:, model:, name:, conversation_flow: nil, description: nil, dynamic_variables: nil, dynamic_variables_webhook_timeout_ms: nil, dynamic_variables_webhook_url: nil, enabled_features: nil, external_llm: nil, fallback_config: nil, greeting: nil, import_metadata: nil, insight_settings: nil, integrations: nil, interruption_settings: nil, llm_api_key_ref: nil, mcp_servers: nil, messaging_settings: nil, observability_settings: nil, post_conversation_settings: nil, privacy_settings: nil, related_mission_ids: nil, tags: nil, telephony_settings: nil, tools: nil, transcription: nil, version_created_at: nil, version_id: nil, version_name: nil, voice_settings: nil, widget_settings: nil)
|
|
235
241
|
# Some parameter documentations has been truncated, see
|
|
236
242
|
# {Telnyx::Models::AI::InferenceEmbedding} for more details.
|
|
237
243
|
#
|
|
@@ -245,6 +251,8 @@ module Telnyx
|
|
|
245
251
|
#
|
|
246
252
|
# @param name [String]
|
|
247
253
|
#
|
|
254
|
+
# @param conversation_flow [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow] Conversation flow as returned by the API.
|
|
255
|
+
#
|
|
248
256
|
# @param description [String]
|
|
249
257
|
#
|
|
250
258
|
# @param dynamic_variables [Hash{Symbol=>Object}] Map of dynamic variables and their values
|
|
@@ -300,6 +308,764 @@ module Telnyx
|
|
|
300
308
|
# @param voice_settings [Telnyx::Models::AI::VoiceSettings]
|
|
301
309
|
#
|
|
302
310
|
# @param widget_settings [Telnyx::Models::AI::WidgetSettings] Configuration settings for the assistant's web widget.
|
|
311
|
+
|
|
312
|
+
# @see Telnyx::Models::AI::InferenceEmbedding#conversation_flow
|
|
313
|
+
class ConversationFlow < Telnyx::Internal::Type::BaseModel
|
|
314
|
+
# @!attribute nodes
|
|
315
|
+
# All nodes in the flow.
|
|
316
|
+
#
|
|
317
|
+
# @return [Array<Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool>]
|
|
318
|
+
required :nodes,
|
|
319
|
+
-> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::AI::InferenceEmbedding::ConversationFlow::Node] }
|
|
320
|
+
|
|
321
|
+
# @!attribute start_node_id
|
|
322
|
+
# ID of the node where the conversation begins.
|
|
323
|
+
#
|
|
324
|
+
# @return [String]
|
|
325
|
+
required :start_node_id, String
|
|
326
|
+
|
|
327
|
+
# @!attribute edges
|
|
328
|
+
# Directed transitions between nodes.
|
|
329
|
+
#
|
|
330
|
+
# @return [Array<Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge>, nil]
|
|
331
|
+
optional :edges,
|
|
332
|
+
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge] }
|
|
333
|
+
|
|
334
|
+
# @!method initialize(nodes:, start_node_id:, edges: nil)
|
|
335
|
+
# Conversation flow as returned by the API.
|
|
336
|
+
#
|
|
337
|
+
# @param nodes [Array<Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool>] All nodes in the flow.
|
|
338
|
+
#
|
|
339
|
+
# @param start_node_id [String] ID of the node where the conversation begins.
|
|
340
|
+
#
|
|
341
|
+
# @param edges [Array<Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge>] Directed transitions between nodes.
|
|
342
|
+
|
|
343
|
+
# One step in a conversation flow, as returned by the API.
|
|
344
|
+
module Node
|
|
345
|
+
extend Telnyx::Internal::Type::Union
|
|
346
|
+
|
|
347
|
+
discriminator :type
|
|
348
|
+
|
|
349
|
+
# One step in a conversation flow, as returned by the API.
|
|
350
|
+
variant :prompt, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt }
|
|
351
|
+
|
|
352
|
+
# A standalone tool step in a conversation flow, as returned by the API.
|
|
353
|
+
variant :tool, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool }
|
|
354
|
+
|
|
355
|
+
class Prompt < Telnyx::Internal::Type::BaseModel
|
|
356
|
+
# @!attribute id
|
|
357
|
+
# Caller-supplied unique identifier for this node within the flow.
|
|
358
|
+
#
|
|
359
|
+
# @return [String]
|
|
360
|
+
required :id, String
|
|
361
|
+
|
|
362
|
+
# @!attribute instructions
|
|
363
|
+
# Prompt that drives the LLM while this node is active. Required.
|
|
364
|
+
#
|
|
365
|
+
# @return [String]
|
|
366
|
+
required :instructions, String
|
|
367
|
+
|
|
368
|
+
# @!attribute external_llm
|
|
369
|
+
# Override for `Assistant.external_llm` while this node is active. Use this to
|
|
370
|
+
# route a node's turns to a different external LLM (different `model`, `base_url`,
|
|
371
|
+
# credentials). Part of the LLM bundle — see `model` for cascade semantics.
|
|
372
|
+
# Mutually exclusive with `model` on the node (a single LLM identity per node).
|
|
373
|
+
#
|
|
374
|
+
# @return [Telnyx::Models::AI::ExternalLlm, nil]
|
|
375
|
+
optional :external_llm, -> { Telnyx::AI::ExternalLlm }
|
|
376
|
+
|
|
377
|
+
# @!attribute instructions_mode
|
|
378
|
+
# How `instructions` combine with the assistant-level instructions. `replace`
|
|
379
|
+
# (default): the node's instructions are used alone. `append`: the node's
|
|
380
|
+
# instructions are concatenated after the assistant's instructions.
|
|
381
|
+
#
|
|
382
|
+
# @return [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode, nil]
|
|
383
|
+
optional :instructions_mode,
|
|
384
|
+
enum: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode }
|
|
385
|
+
|
|
386
|
+
# @!attribute llm_api_key_ref
|
|
387
|
+
# Override for `Assistant.llm_api_key_ref` while this node is active. Part of the
|
|
388
|
+
# LLM bundle — see `model` for cascade semantics.
|
|
389
|
+
#
|
|
390
|
+
# @return [String, nil]
|
|
391
|
+
optional :llm_api_key_ref, String
|
|
392
|
+
|
|
393
|
+
# @!attribute model
|
|
394
|
+
# Override for `Assistant.model` while this node is active. Part of the LLM bundle
|
|
395
|
+
# (`model` + `llm_api_key_ref` + `external_llm`): when any of the three is set on
|
|
396
|
+
# the node, all three are taken from the node and the assistant-level LLM identity
|
|
397
|
+
# is not consulted. When none of the three is set, the assistant's bundle cascades
|
|
398
|
+
# unchanged.
|
|
399
|
+
#
|
|
400
|
+
# @return [String, nil]
|
|
401
|
+
optional :model, String
|
|
402
|
+
|
|
403
|
+
# @!attribute name
|
|
404
|
+
# Optional human-readable label, displayed in authoring UIs.
|
|
405
|
+
#
|
|
406
|
+
# @return [String, nil]
|
|
407
|
+
optional :name, String
|
|
408
|
+
|
|
409
|
+
# @!attribute position
|
|
410
|
+
# Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
411
|
+
# by the runtime; round-trips so frontends can persist graph layout across
|
|
412
|
+
# reloads.
|
|
413
|
+
#
|
|
414
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position, nil]
|
|
415
|
+
optional :position, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position }
|
|
416
|
+
|
|
417
|
+
# @!attribute shared_tool_ids
|
|
418
|
+
# IDs of shared (org-level) tools available at this node. Knowledge bases are
|
|
419
|
+
# attached the same way — via a shared retrieval tool. Tools not listed here are
|
|
420
|
+
# not callable while this node is active.
|
|
421
|
+
#
|
|
422
|
+
# @return [Array<String>, nil]
|
|
423
|
+
optional :shared_tool_ids, Telnyx::Internal::Type::ArrayOf[String]
|
|
424
|
+
|
|
425
|
+
# @!attribute tools
|
|
426
|
+
# Full tool definitions for this node, resolved from `shared_tool_ids`
|
|
427
|
+
# server-side. Populated on responses so clients can render the flow without a
|
|
428
|
+
# follow-up fetch per shared tool. Ignored on input — set `shared_tool_ids` to
|
|
429
|
+
# configure a node's tools.
|
|
430
|
+
#
|
|
431
|
+
# @return [Array<Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>>, nil]
|
|
432
|
+
optional :tools,
|
|
433
|
+
-> { Telnyx::Internal::Type::ArrayOf[Telnyx::Internal::Type::ArrayOf[union: Telnyx::AI::AssistantTool]] }
|
|
434
|
+
|
|
435
|
+
# @!attribute tools_mode
|
|
436
|
+
# How `shared_tool_ids` combine with the assistant-level tool set. `replace`
|
|
437
|
+
# (default): only the node's tools are callable. `append`: the node's tools are
|
|
438
|
+
# added to the assistant's tools. Ignored when `shared_tool_ids` is null.
|
|
439
|
+
#
|
|
440
|
+
# @return [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode, nil]
|
|
441
|
+
optional :tools_mode,
|
|
442
|
+
enum: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode }
|
|
443
|
+
|
|
444
|
+
# @!attribute transcription
|
|
445
|
+
# Per-node transcription override (response form).
|
|
446
|
+
#
|
|
447
|
+
# @return [Telnyx::Models::AI::TranscriptionSettings, nil]
|
|
448
|
+
optional :transcription, -> { Telnyx::AI::TranscriptionSettings }
|
|
449
|
+
|
|
450
|
+
# @!attribute type
|
|
451
|
+
# Node kind discriminator. `prompt` is an LLM-driven step.
|
|
452
|
+
#
|
|
453
|
+
# @return [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type, nil]
|
|
454
|
+
optional :type, enum: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type }
|
|
455
|
+
|
|
456
|
+
# @!attribute voice_settings
|
|
457
|
+
# Per-node voice override (response form).
|
|
458
|
+
#
|
|
459
|
+
# @return [Telnyx::Models::AI::VoiceSettings, nil]
|
|
460
|
+
optional :voice_settings, -> { Telnyx::AI::VoiceSettings }
|
|
461
|
+
|
|
462
|
+
# @!method initialize(id:, instructions:, external_llm: nil, instructions_mode: nil, llm_api_key_ref: nil, model: nil, name: nil, position: nil, shared_tool_ids: nil, tools: nil, tools_mode: nil, transcription: nil, type: nil, voice_settings: nil)
|
|
463
|
+
# Some parameter documentations has been truncated, see
|
|
464
|
+
# {Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt} for
|
|
465
|
+
# more details.
|
|
466
|
+
#
|
|
467
|
+
# One step in a conversation flow, as returned by the API.
|
|
468
|
+
#
|
|
469
|
+
# @param id [String] Caller-supplied unique identifier for this node within the flow.
|
|
470
|
+
#
|
|
471
|
+
# @param instructions [String] Prompt that drives the LLM while this node is active. Required.
|
|
472
|
+
#
|
|
473
|
+
# @param external_llm [Telnyx::Models::AI::ExternalLlm] Override for `Assistant.external_llm` while this node is active. Use this to rou
|
|
474
|
+
#
|
|
475
|
+
# @param instructions_mode [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode] How `instructions` combine with the assistant-level instructions. `replace` (def
|
|
476
|
+
#
|
|
477
|
+
# @param llm_api_key_ref [String] Override for `Assistant.llm_api_key_ref` while this node is active. Part of the
|
|
478
|
+
#
|
|
479
|
+
# @param model [String] Override for `Assistant.model` while this node is active. Part of the LLM bundle
|
|
480
|
+
#
|
|
481
|
+
# @param name [String] Optional human-readable label, displayed in authoring UIs.
|
|
482
|
+
#
|
|
483
|
+
# @param position [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position] Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
484
|
+
#
|
|
485
|
+
# @param shared_tool_ids [Array<String>] IDs of shared (org-level) tools available at this node. Knowledge bases are atta
|
|
486
|
+
#
|
|
487
|
+
# @param tools [Array<Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>>] Full tool definitions for this node, resolved from `shared_tool_ids` server-side
|
|
488
|
+
#
|
|
489
|
+
# @param tools_mode [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode] How `shared_tool_ids` combine with the assistant-level tool set. `replace` (defa
|
|
490
|
+
#
|
|
491
|
+
# @param transcription [Telnyx::Models::AI::TranscriptionSettings] Per-node transcription override (response form).
|
|
492
|
+
#
|
|
493
|
+
# @param type [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type] Node kind discriminator. `prompt` is an LLM-driven step.
|
|
494
|
+
#
|
|
495
|
+
# @param voice_settings [Telnyx::Models::AI::VoiceSettings] Per-node voice override (response form).
|
|
496
|
+
|
|
497
|
+
# How `instructions` combine with the assistant-level instructions. `replace`
|
|
498
|
+
# (default): the node's instructions are used alone. `append`: the node's
|
|
499
|
+
# instructions are concatenated after the assistant's instructions.
|
|
500
|
+
#
|
|
501
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt#instructions_mode
|
|
502
|
+
module InstructionsMode
|
|
503
|
+
extend Telnyx::Internal::Type::Enum
|
|
504
|
+
|
|
505
|
+
REPLACE = :replace
|
|
506
|
+
APPEND = :append
|
|
507
|
+
|
|
508
|
+
# @!method self.values
|
|
509
|
+
# @return [Array<Symbol>]
|
|
510
|
+
end
|
|
511
|
+
|
|
512
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt#position
|
|
513
|
+
class Position < Telnyx::Internal::Type::BaseModel
|
|
514
|
+
# @!attribute x
|
|
515
|
+
# Horizontal coordinate in the authoring canvas.
|
|
516
|
+
#
|
|
517
|
+
# @return [Float]
|
|
518
|
+
required :x, Float
|
|
519
|
+
|
|
520
|
+
# @!attribute y_
|
|
521
|
+
# Vertical coordinate in the authoring canvas.
|
|
522
|
+
#
|
|
523
|
+
# @return [Float]
|
|
524
|
+
required :y_, Float, api_name: :y
|
|
525
|
+
|
|
526
|
+
# @!method initialize(x:, y_:)
|
|
527
|
+
# Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
528
|
+
# by the runtime; round-trips so frontends can persist graph layout across
|
|
529
|
+
# reloads.
|
|
530
|
+
#
|
|
531
|
+
# @param x [Float] Horizontal coordinate in the authoring canvas.
|
|
532
|
+
#
|
|
533
|
+
# @param y_ [Float] Vertical coordinate in the authoring canvas.
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# How `shared_tool_ids` combine with the assistant-level tool set. `replace`
|
|
537
|
+
# (default): only the node's tools are callable. `append`: the node's tools are
|
|
538
|
+
# added to the assistant's tools. Ignored when `shared_tool_ids` is null.
|
|
539
|
+
#
|
|
540
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt#tools_mode
|
|
541
|
+
module ToolsMode
|
|
542
|
+
extend Telnyx::Internal::Type::Enum
|
|
543
|
+
|
|
544
|
+
REPLACE = :replace
|
|
545
|
+
APPEND = :append
|
|
546
|
+
|
|
547
|
+
# @!method self.values
|
|
548
|
+
# @return [Array<Symbol>]
|
|
549
|
+
end
|
|
550
|
+
|
|
551
|
+
# Node kind discriminator. `prompt` is an LLM-driven step.
|
|
552
|
+
#
|
|
553
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt#type
|
|
554
|
+
module Type
|
|
555
|
+
extend Telnyx::Internal::Type::Enum
|
|
556
|
+
|
|
557
|
+
PROMPT = :prompt
|
|
558
|
+
|
|
559
|
+
# @!method self.values
|
|
560
|
+
# @return [Array<Symbol>]
|
|
561
|
+
end
|
|
562
|
+
end
|
|
563
|
+
|
|
564
|
+
class Tool < Telnyx::Internal::Type::BaseModel
|
|
565
|
+
# @!attribute id
|
|
566
|
+
# Caller-supplied unique identifier for this node within the flow.
|
|
567
|
+
#
|
|
568
|
+
# @return [String]
|
|
569
|
+
required :id, String
|
|
570
|
+
|
|
571
|
+
# @!attribute shared_tool_id
|
|
572
|
+
# ID of the single shared (org-level) tool this node executes. When the flow
|
|
573
|
+
# reaches this node the tool runs as a deliberate step (no LLM turn); its outgoing
|
|
574
|
+
# `tool_result` edges then route on the outcome. Arguments are filled from the
|
|
575
|
+
# conversation's dynamic variables by name — a dynamic variable whose name matches
|
|
576
|
+
# one of the tool's parameters supplies that argument. Cross-validated against the
|
|
577
|
+
# org's shared tools on write.
|
|
578
|
+
#
|
|
579
|
+
# @return [String]
|
|
580
|
+
required :shared_tool_id, String
|
|
581
|
+
|
|
582
|
+
# @!attribute name
|
|
583
|
+
# Optional human-readable label, displayed in authoring UIs.
|
|
584
|
+
#
|
|
585
|
+
# @return [String, nil]
|
|
586
|
+
optional :name, String
|
|
587
|
+
|
|
588
|
+
# @!attribute position
|
|
589
|
+
# Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
590
|
+
# by the runtime; round-trips so frontends can persist graph layout across
|
|
591
|
+
# reloads.
|
|
592
|
+
#
|
|
593
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position, nil]
|
|
594
|
+
optional :position, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position }
|
|
595
|
+
|
|
596
|
+
# @!attribute tool
|
|
597
|
+
# Full tool definition resolved from `shared_tool_id` server-side. Populated on
|
|
598
|
+
# responses so clients can render the node without a follow-up fetch. Ignored on
|
|
599
|
+
# input — set `shared_tool_id`.
|
|
600
|
+
#
|
|
601
|
+
# @return [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>, nil]
|
|
602
|
+
optional :tool, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::AI::AssistantTool] }
|
|
603
|
+
|
|
604
|
+
# @!attribute type
|
|
605
|
+
# Node kind discriminator. Always `tool` for a tool node.
|
|
606
|
+
#
|
|
607
|
+
# @return [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type, nil]
|
|
608
|
+
optional :type, enum: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type }
|
|
609
|
+
|
|
610
|
+
# @!method initialize(id:, shared_tool_id:, name: nil, position: nil, tool: nil, type: nil)
|
|
611
|
+
# Some parameter documentations has been truncated, see
|
|
612
|
+
# {Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool} for more
|
|
613
|
+
# details.
|
|
614
|
+
#
|
|
615
|
+
# A standalone tool step in a conversation flow, as returned by the API.
|
|
616
|
+
#
|
|
617
|
+
# @param id [String] Caller-supplied unique identifier for this node within the flow.
|
|
618
|
+
#
|
|
619
|
+
# @param shared_tool_id [String] ID of the single shared (org-level) tool this node executes. When the flow reach
|
|
620
|
+
#
|
|
621
|
+
# @param name [String] Optional human-readable label, displayed in authoring UIs.
|
|
622
|
+
#
|
|
623
|
+
# @param position [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position] Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
624
|
+
#
|
|
625
|
+
# @param tool [Array<Telnyx::Models::AI::InferenceEmbeddingWebhookToolParams, Telnyx::Models::AI::RetrievalTool, Telnyx::Models::AI::AssistantTool::Handoff, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::AssistantTool::Transfer, Telnyx::Models::AI::AssistantTool::Invite, Telnyx::Models::AI::AssistantTool::Refer, Telnyx::Models::AI::AssistantTool::SendDtmf, Telnyx::Models::AI::AssistantTool::SendMessage, Telnyx::Models::AI::AssistantTool::SkipTurn>] Full tool definition resolved from `shared_tool_id` server-side. Populated on re
|
|
626
|
+
#
|
|
627
|
+
# @param type [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type] Node kind discriminator. Always `tool` for a tool node.
|
|
628
|
+
|
|
629
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool#position
|
|
630
|
+
class Position < Telnyx::Internal::Type::BaseModel
|
|
631
|
+
# @!attribute x
|
|
632
|
+
# Horizontal coordinate in the authoring canvas.
|
|
633
|
+
#
|
|
634
|
+
# @return [Float]
|
|
635
|
+
required :x, Float
|
|
636
|
+
|
|
637
|
+
# @!attribute y_
|
|
638
|
+
# Vertical coordinate in the authoring canvas.
|
|
639
|
+
#
|
|
640
|
+
# @return [Float]
|
|
641
|
+
required :y_, Float, api_name: :y
|
|
642
|
+
|
|
643
|
+
# @!method initialize(x:, y_:)
|
|
644
|
+
# Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
|
|
645
|
+
# by the runtime; round-trips so frontends can persist graph layout across
|
|
646
|
+
# reloads.
|
|
647
|
+
#
|
|
648
|
+
# @param x [Float] Horizontal coordinate in the authoring canvas.
|
|
649
|
+
#
|
|
650
|
+
# @param y_ [Float] Vertical coordinate in the authoring canvas.
|
|
651
|
+
end
|
|
652
|
+
|
|
653
|
+
# Node kind discriminator. Always `tool` for a tool node.
|
|
654
|
+
#
|
|
655
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool#type
|
|
656
|
+
module Type
|
|
657
|
+
extend Telnyx::Internal::Type::Enum
|
|
658
|
+
|
|
659
|
+
TOOL = :tool
|
|
660
|
+
|
|
661
|
+
# @!method self.values
|
|
662
|
+
# @return [Array<Symbol>]
|
|
663
|
+
end
|
|
664
|
+
end
|
|
665
|
+
|
|
666
|
+
# @!method self.variants
|
|
667
|
+
# @return [Array(Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Prompt, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Node::Tool)]
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
class Edge < Telnyx::Internal::Type::BaseModel
|
|
671
|
+
# @!attribute id
|
|
672
|
+
# Caller-supplied unique identifier for this edge within the flow.
|
|
673
|
+
#
|
|
674
|
+
# @return [String]
|
|
675
|
+
required :id, String
|
|
676
|
+
|
|
677
|
+
# @!attribute condition
|
|
678
|
+
# Condition that gates the transition. Discriminated by `type`: `llm`,
|
|
679
|
+
# `expression`.
|
|
680
|
+
#
|
|
681
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression]
|
|
682
|
+
required :condition, union: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition }
|
|
683
|
+
|
|
684
|
+
# @!attribute start_node_id
|
|
685
|
+
# ID of the node this edge transitions away from.
|
|
686
|
+
#
|
|
687
|
+
# @return [String]
|
|
688
|
+
required :start_node_id, String
|
|
689
|
+
|
|
690
|
+
# @!attribute target
|
|
691
|
+
# Destination of the transition. Discriminated by `type`: `node` (jump to another
|
|
692
|
+
# node in this flow) or `assistant` (hand off to a different assistant).
|
|
693
|
+
#
|
|
694
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant]
|
|
695
|
+
required :target, union: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target }
|
|
696
|
+
|
|
697
|
+
# @!method initialize(id:, condition:, start_node_id:, target:)
|
|
698
|
+
# Some parameter documentations has been truncated, see
|
|
699
|
+
# {Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge} for more
|
|
700
|
+
# details.
|
|
701
|
+
#
|
|
702
|
+
# Directed transition from one node to a target, gated by a condition.
|
|
703
|
+
#
|
|
704
|
+
# The target is either another node in the same flow (`NodeTarget`) or a different
|
|
705
|
+
# assistant (`AssistantTarget`). Multiple edges may share a `start_node_id`; the
|
|
706
|
+
# runtime evaluates them in the order they're declared and takes the first whose
|
|
707
|
+
# condition is true.
|
|
708
|
+
#
|
|
709
|
+
# @param id [String] Caller-supplied unique identifier for this edge within the flow.
|
|
710
|
+
#
|
|
711
|
+
# @param condition [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression] Condition that gates the transition. Discriminated by `type`: `llm`, `expression
|
|
712
|
+
#
|
|
713
|
+
# @param start_node_id [String] ID of the node this edge transitions away from.
|
|
714
|
+
#
|
|
715
|
+
# @param target [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant] Destination of the transition. Discriminated by `type`: `node` (jump to another
|
|
716
|
+
|
|
717
|
+
# Condition that gates the transition. Discriminated by `type`: `llm`,
|
|
718
|
+
# `expression`.
|
|
719
|
+
#
|
|
720
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge#condition
|
|
721
|
+
module Condition
|
|
722
|
+
extend Telnyx::Internal::Type::Union
|
|
723
|
+
|
|
724
|
+
discriminator :type
|
|
725
|
+
|
|
726
|
+
# Edge condition evaluated by the LLM from a natural-language prompt.
|
|
727
|
+
#
|
|
728
|
+
# The model is asked to judge the prompt against conversation context and
|
|
729
|
+
# returns true/false. Use this for fuzzy intents that aren't expressible as
|
|
730
|
+
# a deterministic expression (e.g. 'user wants to escalate to a human').
|
|
731
|
+
variant :llm, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm }
|
|
732
|
+
|
|
733
|
+
# Edge condition evaluated as a deterministic expression AST.
|
|
734
|
+
#
|
|
735
|
+
# The expression is computed against runtime dynamic variables and must
|
|
736
|
+
# evaluate to a boolean. Prefer this over `LLMCondition` when the rule is
|
|
737
|
+
# a clean function of known variables — it's cheaper and predictable.
|
|
738
|
+
variant :expression, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression }
|
|
739
|
+
|
|
740
|
+
class Llm < Telnyx::Internal::Type::BaseModel
|
|
741
|
+
# @!attribute prompt
|
|
742
|
+
# Natural-language criterion the LLM judges as true/false.
|
|
743
|
+
#
|
|
744
|
+
# @return [String]
|
|
745
|
+
required :prompt, String
|
|
746
|
+
|
|
747
|
+
# @!attribute type
|
|
748
|
+
#
|
|
749
|
+
# @return [Symbol, :llm]
|
|
750
|
+
required :type, const: :llm
|
|
751
|
+
|
|
752
|
+
# @!method initialize(prompt:, type: :llm)
|
|
753
|
+
# Edge condition evaluated by the LLM from a natural-language prompt.
|
|
754
|
+
#
|
|
755
|
+
# The model is asked to judge the prompt against conversation context and returns
|
|
756
|
+
# true/false. Use this for fuzzy intents that aren't expressible as a
|
|
757
|
+
# deterministic expression (e.g. 'user wants to escalate to a human').
|
|
758
|
+
#
|
|
759
|
+
# @param prompt [String] Natural-language criterion the LLM judges as true/false.
|
|
760
|
+
#
|
|
761
|
+
# @param type [Symbol, :llm]
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
class Expression < Telnyx::Internal::Type::BaseModel
|
|
765
|
+
# @!attribute expression
|
|
766
|
+
# A node in a deterministic expression AST. Exactly one variant is selected by the
|
|
767
|
+
# `type` discriminator. Terminal variants (`number_literal`, `string_literal`,
|
|
768
|
+
# `bool_literal`, `variable`) bottom out the recursion; `arithmetic`, `bool_op`,
|
|
769
|
+
# and `comparison` nest further sub-expressions.
|
|
770
|
+
#
|
|
771
|
+
# Extracted into a single named schema so the recursive union is defined once (was
|
|
772
|
+
# previously inlined at every operand site).
|
|
773
|
+
#
|
|
774
|
+
# @return [Object, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression]
|
|
775
|
+
required :expression,
|
|
776
|
+
union: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression }
|
|
777
|
+
|
|
778
|
+
# @!attribute type
|
|
779
|
+
#
|
|
780
|
+
# @return [Symbol, :expression]
|
|
781
|
+
required :type, const: :expression
|
|
782
|
+
|
|
783
|
+
# @!method initialize(expression:, type: :expression)
|
|
784
|
+
# Some parameter documentations has been truncated, see
|
|
785
|
+
# {Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression}
|
|
786
|
+
# for more details.
|
|
787
|
+
#
|
|
788
|
+
# Edge condition evaluated as a deterministic expression AST.
|
|
789
|
+
#
|
|
790
|
+
# The expression is computed against runtime dynamic variables and must evaluate
|
|
791
|
+
# to a boolean. Prefer this over `LLMCondition` when the rule is a clean function
|
|
792
|
+
# of known variables — it's cheaper and predictable.
|
|
793
|
+
#
|
|
794
|
+
# @param expression [Object, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression] A node in a deterministic expression AST. Exactly one variant is selected by the
|
|
795
|
+
#
|
|
796
|
+
# @param type [Symbol, :expression]
|
|
797
|
+
|
|
798
|
+
# A node in a deterministic expression AST. Exactly one variant is selected by the
|
|
799
|
+
# `type` discriminator. Terminal variants (`number_literal`, `string_literal`,
|
|
800
|
+
# `bool_literal`, `variable`) bottom out the recursion; `arithmetic`, `bool_op`,
|
|
801
|
+
# and `comparison` nest further sub-expressions.
|
|
802
|
+
#
|
|
803
|
+
# Extracted into a single named schema so the recursive union is defined once (was
|
|
804
|
+
# previously inlined at every operand site).
|
|
805
|
+
#
|
|
806
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression#expression
|
|
807
|
+
module Expression
|
|
808
|
+
extend Telnyx::Internal::Type::Union
|
|
809
|
+
|
|
810
|
+
variant Telnyx::Internal::Type::Unknown
|
|
811
|
+
|
|
812
|
+
# Reference a dynamic variable by name.
|
|
813
|
+
#
|
|
814
|
+
# Resolved at runtime from the assistant's dynamic-variables context (see
|
|
815
|
+
# `Assistant.dynamic_variables` and the dynamic-variables webhook).
|
|
816
|
+
variant -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression }
|
|
817
|
+
|
|
818
|
+
# Constant string value.
|
|
819
|
+
variant -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression }
|
|
820
|
+
|
|
821
|
+
# Constant numeric value (float; integers are accepted and stored as float).
|
|
822
|
+
variant -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression }
|
|
823
|
+
|
|
824
|
+
# Constant boolean value. Useful for unconditional ('always') edges.
|
|
825
|
+
variant -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression }
|
|
826
|
+
|
|
827
|
+
class DynamicVariableExpression < Telnyx::Internal::Type::BaseModel
|
|
828
|
+
# @!attribute name
|
|
829
|
+
# Variable name to look up in the runtime context.
|
|
830
|
+
#
|
|
831
|
+
# @return [String]
|
|
832
|
+
required :name, String
|
|
833
|
+
|
|
834
|
+
# @!attribute type
|
|
835
|
+
#
|
|
836
|
+
# @return [Symbol, :variable]
|
|
837
|
+
required :type, const: :variable
|
|
838
|
+
|
|
839
|
+
# @!method initialize(name:, type: :variable)
|
|
840
|
+
# Reference a dynamic variable by name.
|
|
841
|
+
#
|
|
842
|
+
# Resolved at runtime from the assistant's dynamic-variables context (see
|
|
843
|
+
# `Assistant.dynamic_variables` and the dynamic-variables webhook).
|
|
844
|
+
#
|
|
845
|
+
# @param name [String] Variable name to look up in the runtime context.
|
|
846
|
+
#
|
|
847
|
+
# @param type [Symbol, :variable]
|
|
848
|
+
end
|
|
849
|
+
|
|
850
|
+
class StringLiteralExpression < Telnyx::Internal::Type::BaseModel
|
|
851
|
+
# @!attribute type
|
|
852
|
+
#
|
|
853
|
+
# @return [Symbol, :string_literal]
|
|
854
|
+
required :type, const: :string_literal
|
|
855
|
+
|
|
856
|
+
# @!attribute value
|
|
857
|
+
# Literal string value.
|
|
858
|
+
#
|
|
859
|
+
# @return [String]
|
|
860
|
+
required :value, String
|
|
861
|
+
|
|
862
|
+
# @!method initialize(value:, type: :string_literal)
|
|
863
|
+
# Constant string value.
|
|
864
|
+
#
|
|
865
|
+
# @param value [String] Literal string value.
|
|
866
|
+
#
|
|
867
|
+
# @param type [Symbol, :string_literal]
|
|
868
|
+
end
|
|
869
|
+
|
|
870
|
+
class NumberLiteralExpression < Telnyx::Internal::Type::BaseModel
|
|
871
|
+
# @!attribute type
|
|
872
|
+
#
|
|
873
|
+
# @return [Symbol, :number_literal]
|
|
874
|
+
required :type, const: :number_literal
|
|
875
|
+
|
|
876
|
+
# @!attribute value
|
|
877
|
+
# Literal numeric value.
|
|
878
|
+
#
|
|
879
|
+
# @return [Float]
|
|
880
|
+
required :value, Float
|
|
881
|
+
|
|
882
|
+
# @!method initialize(value:, type: :number_literal)
|
|
883
|
+
# Constant numeric value (float; integers are accepted and stored as float).
|
|
884
|
+
#
|
|
885
|
+
# @param value [Float] Literal numeric value.
|
|
886
|
+
#
|
|
887
|
+
# @param type [Symbol, :number_literal]
|
|
888
|
+
end
|
|
889
|
+
|
|
890
|
+
class BooleanLiteralExpression < Telnyx::Internal::Type::BaseModel
|
|
891
|
+
# @!attribute type
|
|
892
|
+
#
|
|
893
|
+
# @return [Symbol, :bool_literal]
|
|
894
|
+
required :type, const: :bool_literal
|
|
895
|
+
|
|
896
|
+
# @!attribute value
|
|
897
|
+
# Literal boolean value.
|
|
898
|
+
#
|
|
899
|
+
# @return [Boolean]
|
|
900
|
+
required :value, Telnyx::Internal::Type::Boolean
|
|
901
|
+
|
|
902
|
+
# @!method initialize(value:, type: :bool_literal)
|
|
903
|
+
# Constant boolean value. Useful for unconditional ('always') edges.
|
|
904
|
+
#
|
|
905
|
+
# @param value [Boolean] Literal boolean value.
|
|
906
|
+
#
|
|
907
|
+
# @param type [Symbol, :bool_literal]
|
|
908
|
+
end
|
|
909
|
+
|
|
910
|
+
# @!method self.variants
|
|
911
|
+
# @return [Array(Object, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression)]
|
|
912
|
+
end
|
|
913
|
+
end
|
|
914
|
+
|
|
915
|
+
# @!method self.variants
|
|
916
|
+
# @return [Array(Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression)]
|
|
917
|
+
end
|
|
918
|
+
|
|
919
|
+
# Destination of the transition. Discriminated by `type`: `node` (jump to another
|
|
920
|
+
# node in this flow) or `assistant` (hand off to a different assistant).
|
|
921
|
+
#
|
|
922
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge#target
|
|
923
|
+
module Target
|
|
924
|
+
extend Telnyx::Internal::Type::Union
|
|
925
|
+
|
|
926
|
+
discriminator :type
|
|
927
|
+
|
|
928
|
+
# Edge target referencing another node within the same flow.
|
|
929
|
+
#
|
|
930
|
+
# The runtime transitions the active node to `node_id` and continues
|
|
931
|
+
# processing within the current assistant's flow.
|
|
932
|
+
variant :node, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node }
|
|
933
|
+
|
|
934
|
+
# Edge target referencing a different assistant.
|
|
935
|
+
#
|
|
936
|
+
# When the edge fires, the conversation hands off to `assistant_id`: the
|
|
937
|
+
# active assistant on the conversation row is rewritten and the new
|
|
938
|
+
# assistant's flow starts at its own `start_node_id`. The current turn's
|
|
939
|
+
# LLM response is delivered to the user as-is; subsequent turns route
|
|
940
|
+
# to the new assistant.
|
|
941
|
+
variant :assistant, -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant }
|
|
942
|
+
|
|
943
|
+
class Node < Telnyx::Internal::Type::BaseModel
|
|
944
|
+
# @!attribute node_id
|
|
945
|
+
# ID of the node this edge transitions into.
|
|
946
|
+
#
|
|
947
|
+
# @return [String]
|
|
948
|
+
required :node_id, String
|
|
949
|
+
|
|
950
|
+
# @!attribute type
|
|
951
|
+
#
|
|
952
|
+
# @return [Symbol, :node]
|
|
953
|
+
required :type, const: :node
|
|
954
|
+
|
|
955
|
+
# @!method initialize(node_id:, type: :node)
|
|
956
|
+
# Edge target referencing another node within the same flow.
|
|
957
|
+
#
|
|
958
|
+
# The runtime transitions the active node to `node_id` and continues processing
|
|
959
|
+
# within the current assistant's flow.
|
|
960
|
+
#
|
|
961
|
+
# @param node_id [String] ID of the node this edge transitions into.
|
|
962
|
+
#
|
|
963
|
+
# @param type [Symbol, :node]
|
|
964
|
+
end
|
|
965
|
+
|
|
966
|
+
class Assistant < Telnyx::Internal::Type::BaseModel
|
|
967
|
+
# @!attribute assistant_id
|
|
968
|
+
# ID of the assistant the conversation transitions to.
|
|
969
|
+
#
|
|
970
|
+
# @return [String]
|
|
971
|
+
required :assistant_id, String
|
|
972
|
+
|
|
973
|
+
# @!attribute type
|
|
974
|
+
#
|
|
975
|
+
# @return [Symbol, :assistant]
|
|
976
|
+
required :type, const: :assistant
|
|
977
|
+
|
|
978
|
+
# @!attribute position
|
|
979
|
+
# Optional canvas coordinates for rendering the target assistant as a node in
|
|
980
|
+
# authoring UIs. Pure presentation — the runtime ignores it; round-trips so
|
|
981
|
+
# frontends can persist graph layout across reloads. When multiple edges target
|
|
982
|
+
# the same assistant, each edge's `position` is independent (frontends typically
|
|
983
|
+
# use the first non-null one).
|
|
984
|
+
#
|
|
985
|
+
# @return [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position, nil]
|
|
986
|
+
optional :position,
|
|
987
|
+
-> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position }
|
|
988
|
+
|
|
989
|
+
# @!attribute voice_mode
|
|
990
|
+
# Voice behavior when handing off to the target assistant, mirroring the handoff
|
|
991
|
+
# tool's `voice_mode`. `unified` (default) keeps the current voice across the
|
|
992
|
+
# handoff; `distinct` lets the target assistant speak with its own configured
|
|
993
|
+
# voice. Only applies to assistant targets — node targets override voice via the
|
|
994
|
+
# node's own `voice_settings`.
|
|
995
|
+
#
|
|
996
|
+
# @return [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode, nil]
|
|
997
|
+
optional :voice_mode,
|
|
998
|
+
enum: -> { Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode }
|
|
999
|
+
|
|
1000
|
+
# @!method initialize(assistant_id:, position: nil, voice_mode: nil, type: :assistant)
|
|
1001
|
+
# Some parameter documentations has been truncated, see
|
|
1002
|
+
# {Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant}
|
|
1003
|
+
# for more details.
|
|
1004
|
+
#
|
|
1005
|
+
# Edge target referencing a different assistant.
|
|
1006
|
+
#
|
|
1007
|
+
# When the edge fires, the conversation hands off to `assistant_id`: the active
|
|
1008
|
+
# assistant on the conversation row is rewritten and the new assistant's flow
|
|
1009
|
+
# starts at its own `start_node_id`. The current turn's LLM response is delivered
|
|
1010
|
+
# to the user as-is; subsequent turns route to the new assistant.
|
|
1011
|
+
#
|
|
1012
|
+
# @param assistant_id [String] ID of the assistant the conversation transitions to.
|
|
1013
|
+
#
|
|
1014
|
+
# @param position [Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position] Optional canvas coordinates for rendering the target assistant as a node in auth
|
|
1015
|
+
#
|
|
1016
|
+
# @param voice_mode [Symbol, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode] Voice behavior when handing off to the target assistant, mirroring the handoff t
|
|
1017
|
+
#
|
|
1018
|
+
# @param type [Symbol, :assistant]
|
|
1019
|
+
|
|
1020
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant#position
|
|
1021
|
+
class Position < Telnyx::Internal::Type::BaseModel
|
|
1022
|
+
# @!attribute x
|
|
1023
|
+
# Horizontal coordinate in the authoring canvas.
|
|
1024
|
+
#
|
|
1025
|
+
# @return [Float]
|
|
1026
|
+
required :x, Float
|
|
1027
|
+
|
|
1028
|
+
# @!attribute y_
|
|
1029
|
+
# Vertical coordinate in the authoring canvas.
|
|
1030
|
+
#
|
|
1031
|
+
# @return [Float]
|
|
1032
|
+
required :y_, Float, api_name: :y
|
|
1033
|
+
|
|
1034
|
+
# @!method initialize(x:, y_:)
|
|
1035
|
+
# Optional canvas coordinates for rendering the target assistant as a node in
|
|
1036
|
+
# authoring UIs. Pure presentation — the runtime ignores it; round-trips so
|
|
1037
|
+
# frontends can persist graph layout across reloads. When multiple edges target
|
|
1038
|
+
# the same assistant, each edge's `position` is independent (frontends typically
|
|
1039
|
+
# use the first non-null one).
|
|
1040
|
+
#
|
|
1041
|
+
# @param x [Float] Horizontal coordinate in the authoring canvas.
|
|
1042
|
+
#
|
|
1043
|
+
# @param y_ [Float] Vertical coordinate in the authoring canvas.
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
# Voice behavior when handing off to the target assistant, mirroring the handoff
|
|
1047
|
+
# tool's `voice_mode`. `unified` (default) keeps the current voice across the
|
|
1048
|
+
# handoff; `distinct` lets the target assistant speak with its own configured
|
|
1049
|
+
# voice. Only applies to assistant targets — node targets override voice via the
|
|
1050
|
+
# node's own `voice_settings`.
|
|
1051
|
+
#
|
|
1052
|
+
# @see Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant#voice_mode
|
|
1053
|
+
module VoiceMode
|
|
1054
|
+
extend Telnyx::Internal::Type::Enum
|
|
1055
|
+
|
|
1056
|
+
UNIFIED = :unified
|
|
1057
|
+
DISTINCT = :distinct
|
|
1058
|
+
|
|
1059
|
+
# @!method self.values
|
|
1060
|
+
# @return [Array<Symbol>]
|
|
1061
|
+
end
|
|
1062
|
+
end
|
|
1063
|
+
|
|
1064
|
+
# @!method self.variants
|
|
1065
|
+
# @return [Array(Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node, Telnyx::Models::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant)]
|
|
1066
|
+
end
|
|
1067
|
+
end
|
|
1068
|
+
end
|
|
303
1069
|
end
|
|
304
1070
|
end
|
|
305
1071
|
end
|