telnyx 5.122.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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +5 -0
  5. data/lib/telnyx/models/ai/assistant_create_params.rb +780 -1
  6. data/lib/telnyx/models/ai/assistant_update_params.rb +780 -1
  7. data/lib/telnyx/models/ai/assistants/update_assistant.rb +785 -1
  8. data/lib/telnyx/models/ai/inference_embedding.rb +767 -1
  9. data/lib/telnyx/models/{ai_create_response_params.rb → ai_create_response_deprecated_params.rb} +2 -2
  10. data/lib/telnyx/models/{ai_create_response_response.rb → ai_create_response_deprecated_response.rb} +1 -1
  11. data/lib/telnyx/models/messaging_profile_update_params.rb +9 -1
  12. data/lib/telnyx/models/sip_registration_status_retrieve_params.rb +45 -0
  13. data/lib/telnyx/models/sip_registration_status_retrieve_response.rb +160 -0
  14. data/lib/telnyx/models/speech_to_text_list_providers_params.rb +16 -5
  15. data/lib/telnyx/models/speech_to_text_list_providers_response.rb +55 -23
  16. data/lib/telnyx/models.rb +3 -1
  17. data/lib/telnyx/resources/ai/assistants/versions.rb +3 -1
  18. data/lib/telnyx/resources/ai/assistants.rb +6 -2
  19. data/lib/telnyx/resources/ai.rb +4 -4
  20. data/lib/telnyx/resources/messaging_profiles.rb +3 -1
  21. data/lib/telnyx/resources/sip_registration_status.rb +45 -0
  22. data/lib/telnyx/resources/speech_to_text.rb +6 -5
  23. data/lib/telnyx/version.rb +1 -1
  24. data/lib/telnyx.rb +5 -2
  25. data/rbi/telnyx/client.rbi +4 -0
  26. data/rbi/telnyx/models/ai/assistant_create_params.rbi +1411 -0
  27. data/rbi/telnyx/models/ai/assistant_update_params.rbi +1411 -0
  28. data/rbi/telnyx/models/ai/assistants/update_assistant.rbi +1417 -0
  29. data/rbi/telnyx/models/ai/inference_embedding.rbi +1454 -0
  30. data/rbi/telnyx/models/{ai_create_response_params.rbi → ai_create_response_deprecated_params.rbi} +5 -2
  31. data/rbi/telnyx/models/{ai_create_response_response.rbi → ai_create_response_deprecated_response.rbi} +1 -1
  32. data/rbi/telnyx/models/messaging_profile_update_params.rbi +8 -0
  33. data/rbi/telnyx/models/sip_registration_status_retrieve_params.rbi +93 -0
  34. data/rbi/telnyx/models/sip_registration_status_retrieve_response.rbi +343 -0
  35. data/rbi/telnyx/models/speech_to_text_list_providers_params.rbi +27 -7
  36. data/rbi/telnyx/models/speech_to_text_list_providers_response.rbi +107 -43
  37. data/rbi/telnyx/models.rbi +5 -1
  38. data/rbi/telnyx/resources/ai/assistants/versions.rbi +8 -0
  39. data/rbi/telnyx/resources/ai/assistants.rbi +16 -0
  40. data/rbi/telnyx/resources/ai.rbi +1 -1
  41. data/rbi/telnyx/resources/messaging_profiles.rbi +3 -0
  42. data/rbi/telnyx/resources/sip_registration_status.rbi +34 -0
  43. data/rbi/telnyx/resources/speech_to_text.rbi +11 -5
  44. data/sig/telnyx/client.rbs +2 -0
  45. data/sig/telnyx/models/ai/assistant_create_params.rbs +508 -0
  46. data/sig/telnyx/models/ai/assistant_update_params.rbs +508 -0
  47. data/sig/telnyx/models/ai/assistants/update_assistant.rbs +511 -0
  48. data/sig/telnyx/models/ai/inference_embedding.rbs +526 -0
  49. data/sig/telnyx/models/{ai_create_response_params.rbs → ai_create_response_deprecated_params.rbs} +2 -2
  50. data/sig/telnyx/models/ai_create_response_deprecated_response.rbs +7 -0
  51. data/sig/telnyx/models/messaging_profile_update_params.rbs +5 -0
  52. data/sig/telnyx/models/sip_registration_status_retrieve_params.rbs +41 -0
  53. data/sig/telnyx/models/sip_registration_status_retrieve_response.rbs +164 -0
  54. data/sig/telnyx/models/speech_to_text_list_providers_params.rbs +4 -4
  55. data/sig/telnyx/models/speech_to_text_list_providers_response.rbs +33 -16
  56. data/sig/telnyx/models.rbs +3 -1
  57. data/sig/telnyx/resources/ai/assistants/versions.rbs +1 -0
  58. data/sig/telnyx/resources/ai/assistants.rbs +2 -0
  59. data/sig/telnyx/resources/ai.rbs +2 -2
  60. data/sig/telnyx/resources/messaging_profiles.rbs +1 -0
  61. data/sig/telnyx/resources/sip_registration_status.rbs +13 -0
  62. metadata +17 -8
  63. data/sig/telnyx/models/ai_create_response_response.rbs +0 -7
@@ -31,6 +31,20 @@ module Telnyx
31
31
  sig { returns(String) }
32
32
  attr_accessor :name
33
33
 
34
+ # Conversation flow as returned by the API.
35
+ sig do
36
+ returns(T.nilable(Telnyx::AI::InferenceEmbedding::ConversationFlow))
37
+ end
38
+ attr_reader :conversation_flow
39
+
40
+ sig do
41
+ params(
42
+ conversation_flow:
43
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::OrHash
44
+ ).void
45
+ end
46
+ attr_writer :conversation_flow
47
+
34
48
  sig { returns(T.nilable(String)) }
35
49
  attr_reader :description
36
50
 
@@ -320,6 +334,8 @@ module Telnyx
320
334
  instructions: String,
321
335
  model: String,
322
336
  name: String,
337
+ conversation_flow:
338
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::OrHash,
323
339
  description: String,
324
340
  dynamic_variables: T::Hash[Symbol, T.anything],
325
341
  dynamic_variables_webhook_timeout_ms: Integer,
@@ -379,6 +395,8 @@ module Telnyx
379
395
  # provided, Telnyx applies the default model.
380
396
  model:,
381
397
  name:,
398
+ # Conversation flow as returned by the API.
399
+ conversation_flow: nil,
382
400
  description: nil,
383
401
  # Map of dynamic variables and their values
384
402
  dynamic_variables: nil,
@@ -472,6 +490,8 @@ module Telnyx
472
490
  instructions: String,
473
491
  model: String,
474
492
  name: String,
493
+ conversation_flow:
494
+ Telnyx::AI::InferenceEmbedding::ConversationFlow,
475
495
  description: String,
476
496
  dynamic_variables: T::Hash[Symbol, T.anything],
477
497
  dynamic_variables_webhook_timeout_ms: Integer,
@@ -507,6 +527,1440 @@ module Telnyx
507
527
  end
508
528
  def to_hash
509
529
  end
530
+
531
+ class ConversationFlow < Telnyx::Internal::Type::BaseModel
532
+ OrHash =
533
+ T.type_alias do
534
+ T.any(
535
+ Telnyx::AI::InferenceEmbedding::ConversationFlow,
536
+ Telnyx::Internal::AnyHash
537
+ )
538
+ end
539
+
540
+ # All nodes in the flow.
541
+ sig do
542
+ returns(
543
+ T::Array[
544
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Variants
545
+ ]
546
+ )
547
+ end
548
+ attr_accessor :nodes
549
+
550
+ # ID of the node where the conversation begins.
551
+ sig { returns(String) }
552
+ attr_accessor :start_node_id
553
+
554
+ # Directed transitions between nodes.
555
+ sig do
556
+ returns(
557
+ T.nilable(
558
+ T::Array[Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge]
559
+ )
560
+ )
561
+ end
562
+ attr_reader :edges
563
+
564
+ sig do
565
+ params(
566
+ edges:
567
+ T::Array[
568
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::OrHash
569
+ ]
570
+ ).void
571
+ end
572
+ attr_writer :edges
573
+
574
+ # Conversation flow as returned by the API.
575
+ sig do
576
+ params(
577
+ nodes:
578
+ T::Array[
579
+ T.any(
580
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::OrHash,
581
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::OrHash
582
+ )
583
+ ],
584
+ start_node_id: String,
585
+ edges:
586
+ T::Array[
587
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::OrHash
588
+ ]
589
+ ).returns(T.attached_class)
590
+ end
591
+ def self.new(
592
+ # All nodes in the flow.
593
+ nodes:,
594
+ # ID of the node where the conversation begins.
595
+ start_node_id:,
596
+ # Directed transitions between nodes.
597
+ edges: nil
598
+ )
599
+ end
600
+
601
+ sig do
602
+ override.returns(
603
+ {
604
+ nodes:
605
+ T::Array[
606
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Variants
607
+ ],
608
+ start_node_id: String,
609
+ edges:
610
+ T::Array[
611
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge
612
+ ]
613
+ }
614
+ )
615
+ end
616
+ def to_hash
617
+ end
618
+
619
+ # One step in a conversation flow, as returned by the API.
620
+ module Node
621
+ extend Telnyx::Internal::Type::Union
622
+
623
+ Variants =
624
+ T.type_alias do
625
+ T.any(
626
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt,
627
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool
628
+ )
629
+ end
630
+
631
+ class Prompt < Telnyx::Internal::Type::BaseModel
632
+ OrHash =
633
+ T.type_alias do
634
+ T.any(
635
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt,
636
+ Telnyx::Internal::AnyHash
637
+ )
638
+ end
639
+
640
+ # Caller-supplied unique identifier for this node within the flow.
641
+ sig { returns(String) }
642
+ attr_accessor :id
643
+
644
+ # Prompt that drives the LLM while this node is active. Required.
645
+ sig { returns(String) }
646
+ attr_accessor :instructions
647
+
648
+ # Override for `Assistant.external_llm` while this node is active. Use this to
649
+ # route a node's turns to a different external LLM (different `model`, `base_url`,
650
+ # credentials). Part of the LLM bundle — see `model` for cascade semantics.
651
+ # Mutually exclusive with `model` on the node (a single LLM identity per node).
652
+ sig { returns(T.nilable(Telnyx::AI::ExternalLlm)) }
653
+ attr_reader :external_llm
654
+
655
+ sig { params(external_llm: Telnyx::AI::ExternalLlm::OrHash).void }
656
+ attr_writer :external_llm
657
+
658
+ # How `instructions` combine with the assistant-level instructions. `replace`
659
+ # (default): the node's instructions are used alone. `append`: the node's
660
+ # instructions are concatenated after the assistant's instructions.
661
+ sig do
662
+ returns(
663
+ T.nilable(
664
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::TaggedSymbol
665
+ )
666
+ )
667
+ end
668
+ attr_reader :instructions_mode
669
+
670
+ sig do
671
+ params(
672
+ instructions_mode:
673
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::OrSymbol
674
+ ).void
675
+ end
676
+ attr_writer :instructions_mode
677
+
678
+ # Override for `Assistant.llm_api_key_ref` while this node is active. Part of the
679
+ # LLM bundle — see `model` for cascade semantics.
680
+ sig { returns(T.nilable(String)) }
681
+ attr_reader :llm_api_key_ref
682
+
683
+ sig { params(llm_api_key_ref: String).void }
684
+ attr_writer :llm_api_key_ref
685
+
686
+ # Override for `Assistant.model` while this node is active. Part of the LLM bundle
687
+ # (`model` + `llm_api_key_ref` + `external_llm`): when any of the three is set on
688
+ # the node, all three are taken from the node and the assistant-level LLM identity
689
+ # is not consulted. When none of the three is set, the assistant's bundle cascades
690
+ # unchanged.
691
+ sig { returns(T.nilable(String)) }
692
+ attr_reader :model
693
+
694
+ sig { params(model: String).void }
695
+ attr_writer :model
696
+
697
+ # Optional human-readable label, displayed in authoring UIs.
698
+ sig { returns(T.nilable(String)) }
699
+ attr_reader :name
700
+
701
+ sig { params(name: String).void }
702
+ attr_writer :name
703
+
704
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
705
+ # by the runtime; round-trips so frontends can persist graph layout across
706
+ # reloads.
707
+ sig do
708
+ returns(
709
+ T.nilable(
710
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position
711
+ )
712
+ )
713
+ end
714
+ attr_reader :position
715
+
716
+ sig do
717
+ params(
718
+ position:
719
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position::OrHash
720
+ ).void
721
+ end
722
+ attr_writer :position
723
+
724
+ # IDs of shared (org-level) tools available at this node. Knowledge bases are
725
+ # attached the same way — via a shared retrieval tool. Tools not listed here are
726
+ # not callable while this node is active.
727
+ sig { returns(T.nilable(T::Array[String])) }
728
+ attr_reader :shared_tool_ids
729
+
730
+ sig { params(shared_tool_ids: T::Array[String]).void }
731
+ attr_writer :shared_tool_ids
732
+
733
+ # Full tool definitions for this node, resolved from `shared_tool_ids`
734
+ # server-side. Populated on responses so clients can render the flow without a
735
+ # follow-up fetch per shared tool. Ignored on input — set `shared_tool_ids` to
736
+ # configure a node's tools.
737
+ sig do
738
+ returns(
739
+ T.nilable(
740
+ T::Array[T::Array[Telnyx::AI::AssistantTool::Variants]]
741
+ )
742
+ )
743
+ end
744
+ attr_reader :tools
745
+
746
+ sig do
747
+ params(
748
+ tools:
749
+ T::Array[
750
+ T::Array[
751
+ T.any(
752
+ Telnyx::AI::InferenceEmbeddingWebhookToolParams::OrHash,
753
+ Telnyx::AI::RetrievalTool::OrHash,
754
+ Telnyx::AI::AssistantTool::Handoff::OrHash,
755
+ Telnyx::AI::HangupTool::OrHash,
756
+ Telnyx::AI::AssistantTool::Transfer::OrHash,
757
+ Telnyx::AI::AssistantTool::Invite::OrHash,
758
+ Telnyx::AI::AssistantTool::Refer::OrHash,
759
+ Telnyx::AI::AssistantTool::SendDtmf::OrHash,
760
+ Telnyx::AI::AssistantTool::SendMessage::OrHash,
761
+ Telnyx::AI::AssistantTool::SkipTurn::OrHash
762
+ )
763
+ ]
764
+ ]
765
+ ).void
766
+ end
767
+ attr_writer :tools
768
+
769
+ # How `shared_tool_ids` combine with the assistant-level tool set. `replace`
770
+ # (default): only the node's tools are callable. `append`: the node's tools are
771
+ # added to the assistant's tools. Ignored when `shared_tool_ids` is null.
772
+ sig do
773
+ returns(
774
+ T.nilable(
775
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::TaggedSymbol
776
+ )
777
+ )
778
+ end
779
+ attr_reader :tools_mode
780
+
781
+ sig do
782
+ params(
783
+ tools_mode:
784
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::OrSymbol
785
+ ).void
786
+ end
787
+ attr_writer :tools_mode
788
+
789
+ # Per-node transcription override (response form).
790
+ sig { returns(T.nilable(Telnyx::AI::TranscriptionSettings)) }
791
+ attr_reader :transcription
792
+
793
+ sig do
794
+ params(
795
+ transcription: Telnyx::AI::TranscriptionSettings::OrHash
796
+ ).void
797
+ end
798
+ attr_writer :transcription
799
+
800
+ # Node kind discriminator. `prompt` is an LLM-driven step.
801
+ sig do
802
+ returns(
803
+ T.nilable(
804
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::TaggedSymbol
805
+ )
806
+ )
807
+ end
808
+ attr_reader :type
809
+
810
+ sig do
811
+ params(
812
+ type:
813
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::OrSymbol
814
+ ).void
815
+ end
816
+ attr_writer :type
817
+
818
+ # Per-node voice override (response form).
819
+ sig { returns(T.nilable(Telnyx::AI::VoiceSettings)) }
820
+ attr_reader :voice_settings
821
+
822
+ sig do
823
+ params(voice_settings: Telnyx::AI::VoiceSettings::OrHash).void
824
+ end
825
+ attr_writer :voice_settings
826
+
827
+ # One step in a conversation flow, as returned by the API.
828
+ sig do
829
+ params(
830
+ id: String,
831
+ instructions: String,
832
+ external_llm: Telnyx::AI::ExternalLlm::OrHash,
833
+ instructions_mode:
834
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::OrSymbol,
835
+ llm_api_key_ref: String,
836
+ model: String,
837
+ name: String,
838
+ position:
839
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position::OrHash,
840
+ shared_tool_ids: T::Array[String],
841
+ tools:
842
+ T::Array[
843
+ T::Array[
844
+ T.any(
845
+ Telnyx::AI::InferenceEmbeddingWebhookToolParams::OrHash,
846
+ Telnyx::AI::RetrievalTool::OrHash,
847
+ Telnyx::AI::AssistantTool::Handoff::OrHash,
848
+ Telnyx::AI::HangupTool::OrHash,
849
+ Telnyx::AI::AssistantTool::Transfer::OrHash,
850
+ Telnyx::AI::AssistantTool::Invite::OrHash,
851
+ Telnyx::AI::AssistantTool::Refer::OrHash,
852
+ Telnyx::AI::AssistantTool::SendDtmf::OrHash,
853
+ Telnyx::AI::AssistantTool::SendMessage::OrHash,
854
+ Telnyx::AI::AssistantTool::SkipTurn::OrHash
855
+ )
856
+ ]
857
+ ],
858
+ tools_mode:
859
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::OrSymbol,
860
+ transcription: Telnyx::AI::TranscriptionSettings::OrHash,
861
+ type:
862
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::OrSymbol,
863
+ voice_settings: Telnyx::AI::VoiceSettings::OrHash
864
+ ).returns(T.attached_class)
865
+ end
866
+ def self.new(
867
+ # Caller-supplied unique identifier for this node within the flow.
868
+ id:,
869
+ # Prompt that drives the LLM while this node is active. Required.
870
+ instructions:,
871
+ # Override for `Assistant.external_llm` while this node is active. Use this to
872
+ # route a node's turns to a different external LLM (different `model`, `base_url`,
873
+ # credentials). Part of the LLM bundle — see `model` for cascade semantics.
874
+ # Mutually exclusive with `model` on the node (a single LLM identity per node).
875
+ external_llm: nil,
876
+ # How `instructions` combine with the assistant-level instructions. `replace`
877
+ # (default): the node's instructions are used alone. `append`: the node's
878
+ # instructions are concatenated after the assistant's instructions.
879
+ instructions_mode: nil,
880
+ # Override for `Assistant.llm_api_key_ref` while this node is active. Part of the
881
+ # LLM bundle — see `model` for cascade semantics.
882
+ llm_api_key_ref: nil,
883
+ # Override for `Assistant.model` while this node is active. Part of the LLM bundle
884
+ # (`model` + `llm_api_key_ref` + `external_llm`): when any of the three is set on
885
+ # the node, all three are taken from the node and the assistant-level LLM identity
886
+ # is not consulted. When none of the three is set, the assistant's bundle cascades
887
+ # unchanged.
888
+ model: nil,
889
+ # Optional human-readable label, displayed in authoring UIs.
890
+ name: nil,
891
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
892
+ # by the runtime; round-trips so frontends can persist graph layout across
893
+ # reloads.
894
+ position: nil,
895
+ # IDs of shared (org-level) tools available at this node. Knowledge bases are
896
+ # attached the same way — via a shared retrieval tool. Tools not listed here are
897
+ # not callable while this node is active.
898
+ shared_tool_ids: nil,
899
+ # Full tool definitions for this node, resolved from `shared_tool_ids`
900
+ # server-side. Populated on responses so clients can render the flow without a
901
+ # follow-up fetch per shared tool. Ignored on input — set `shared_tool_ids` to
902
+ # configure a node's tools.
903
+ tools: nil,
904
+ # How `shared_tool_ids` combine with the assistant-level tool set. `replace`
905
+ # (default): only the node's tools are callable. `append`: the node's tools are
906
+ # added to the assistant's tools. Ignored when `shared_tool_ids` is null.
907
+ tools_mode: nil,
908
+ # Per-node transcription override (response form).
909
+ transcription: nil,
910
+ # Node kind discriminator. `prompt` is an LLM-driven step.
911
+ type: nil,
912
+ # Per-node voice override (response form).
913
+ voice_settings: nil
914
+ )
915
+ end
916
+
917
+ sig do
918
+ override.returns(
919
+ {
920
+ id: String,
921
+ instructions: String,
922
+ external_llm: Telnyx::AI::ExternalLlm,
923
+ instructions_mode:
924
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::TaggedSymbol,
925
+ llm_api_key_ref: String,
926
+ model: String,
927
+ name: String,
928
+ position:
929
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position,
930
+ shared_tool_ids: T::Array[String],
931
+ tools:
932
+ T::Array[T::Array[Telnyx::AI::AssistantTool::Variants]],
933
+ tools_mode:
934
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::TaggedSymbol,
935
+ transcription: Telnyx::AI::TranscriptionSettings,
936
+ type:
937
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::TaggedSymbol,
938
+ voice_settings: Telnyx::AI::VoiceSettings
939
+ }
940
+ )
941
+ end
942
+ def to_hash
943
+ end
944
+
945
+ # How `instructions` combine with the assistant-level instructions. `replace`
946
+ # (default): the node's instructions are used alone. `append`: the node's
947
+ # instructions are concatenated after the assistant's instructions.
948
+ module InstructionsMode
949
+ extend Telnyx::Internal::Type::Enum
950
+
951
+ TaggedSymbol =
952
+ T.type_alias do
953
+ T.all(
954
+ Symbol,
955
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode
956
+ )
957
+ end
958
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
959
+
960
+ REPLACE =
961
+ T.let(
962
+ :replace,
963
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::TaggedSymbol
964
+ )
965
+ APPEND =
966
+ T.let(
967
+ :append,
968
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::TaggedSymbol
969
+ )
970
+
971
+ sig do
972
+ override.returns(
973
+ T::Array[
974
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::InstructionsMode::TaggedSymbol
975
+ ]
976
+ )
977
+ end
978
+ def self.values
979
+ end
980
+ end
981
+
982
+ class Position < Telnyx::Internal::Type::BaseModel
983
+ OrHash =
984
+ T.type_alias do
985
+ T.any(
986
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Position,
987
+ Telnyx::Internal::AnyHash
988
+ )
989
+ end
990
+
991
+ # Horizontal coordinate in the authoring canvas.
992
+ sig { returns(Float) }
993
+ attr_accessor :x
994
+
995
+ # Vertical coordinate in the authoring canvas.
996
+ sig { returns(Float) }
997
+ attr_accessor :y_
998
+
999
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
1000
+ # by the runtime; round-trips so frontends can persist graph layout across
1001
+ # reloads.
1002
+ sig { params(x: Float, y_: Float).returns(T.attached_class) }
1003
+ def self.new(
1004
+ # Horizontal coordinate in the authoring canvas.
1005
+ x:,
1006
+ # Vertical coordinate in the authoring canvas.
1007
+ y_:
1008
+ )
1009
+ end
1010
+
1011
+ sig { override.returns({ x: Float, y_: Float }) }
1012
+ def to_hash
1013
+ end
1014
+ end
1015
+
1016
+ # How `shared_tool_ids` combine with the assistant-level tool set. `replace`
1017
+ # (default): only the node's tools are callable. `append`: the node's tools are
1018
+ # added to the assistant's tools. Ignored when `shared_tool_ids` is null.
1019
+ module ToolsMode
1020
+ extend Telnyx::Internal::Type::Enum
1021
+
1022
+ TaggedSymbol =
1023
+ T.type_alias do
1024
+ T.all(
1025
+ Symbol,
1026
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode
1027
+ )
1028
+ end
1029
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1030
+
1031
+ REPLACE =
1032
+ T.let(
1033
+ :replace,
1034
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::TaggedSymbol
1035
+ )
1036
+ APPEND =
1037
+ T.let(
1038
+ :append,
1039
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::TaggedSymbol
1040
+ )
1041
+
1042
+ sig do
1043
+ override.returns(
1044
+ T::Array[
1045
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::ToolsMode::TaggedSymbol
1046
+ ]
1047
+ )
1048
+ end
1049
+ def self.values
1050
+ end
1051
+ end
1052
+
1053
+ # Node kind discriminator. `prompt` is an LLM-driven step.
1054
+ module Type
1055
+ extend Telnyx::Internal::Type::Enum
1056
+
1057
+ TaggedSymbol =
1058
+ T.type_alias do
1059
+ T.all(
1060
+ Symbol,
1061
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type
1062
+ )
1063
+ end
1064
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1065
+
1066
+ PROMPT =
1067
+ T.let(
1068
+ :prompt,
1069
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::TaggedSymbol
1070
+ )
1071
+
1072
+ sig do
1073
+ override.returns(
1074
+ T::Array[
1075
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Prompt::Type::TaggedSymbol
1076
+ ]
1077
+ )
1078
+ end
1079
+ def self.values
1080
+ end
1081
+ end
1082
+ end
1083
+
1084
+ class Tool < Telnyx::Internal::Type::BaseModel
1085
+ OrHash =
1086
+ T.type_alias do
1087
+ T.any(
1088
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool,
1089
+ Telnyx::Internal::AnyHash
1090
+ )
1091
+ end
1092
+
1093
+ # Caller-supplied unique identifier for this node within the flow.
1094
+ sig { returns(String) }
1095
+ attr_accessor :id
1096
+
1097
+ # ID of the single shared (org-level) tool this node executes. When the flow
1098
+ # reaches this node the tool runs as a deliberate step (no LLM turn); its outgoing
1099
+ # `tool_result` edges then route on the outcome. Arguments are filled from the
1100
+ # conversation's dynamic variables by name — a dynamic variable whose name matches
1101
+ # one of the tool's parameters supplies that argument. Cross-validated against the
1102
+ # org's shared tools on write.
1103
+ sig { returns(String) }
1104
+ attr_accessor :shared_tool_id
1105
+
1106
+ # Optional human-readable label, displayed in authoring UIs.
1107
+ sig { returns(T.nilable(String)) }
1108
+ attr_reader :name
1109
+
1110
+ sig { params(name: String).void }
1111
+ attr_writer :name
1112
+
1113
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
1114
+ # by the runtime; round-trips so frontends can persist graph layout across
1115
+ # reloads.
1116
+ sig do
1117
+ returns(
1118
+ T.nilable(
1119
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position
1120
+ )
1121
+ )
1122
+ end
1123
+ attr_reader :position
1124
+
1125
+ sig do
1126
+ params(
1127
+ position:
1128
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position::OrHash
1129
+ ).void
1130
+ end
1131
+ attr_writer :position
1132
+
1133
+ # Full tool definition resolved from `shared_tool_id` server-side. Populated on
1134
+ # responses so clients can render the node without a follow-up fetch. Ignored on
1135
+ # input — set `shared_tool_id`.
1136
+ sig do
1137
+ returns(
1138
+ T.nilable(T::Array[Telnyx::AI::AssistantTool::Variants])
1139
+ )
1140
+ end
1141
+ attr_reader :tool
1142
+
1143
+ sig do
1144
+ params(
1145
+ tool:
1146
+ T::Array[
1147
+ T.any(
1148
+ Telnyx::AI::InferenceEmbeddingWebhookToolParams::OrHash,
1149
+ Telnyx::AI::RetrievalTool::OrHash,
1150
+ Telnyx::AI::AssistantTool::Handoff::OrHash,
1151
+ Telnyx::AI::HangupTool::OrHash,
1152
+ Telnyx::AI::AssistantTool::Transfer::OrHash,
1153
+ Telnyx::AI::AssistantTool::Invite::OrHash,
1154
+ Telnyx::AI::AssistantTool::Refer::OrHash,
1155
+ Telnyx::AI::AssistantTool::SendDtmf::OrHash,
1156
+ Telnyx::AI::AssistantTool::SendMessage::OrHash,
1157
+ Telnyx::AI::AssistantTool::SkipTurn::OrHash
1158
+ )
1159
+ ]
1160
+ ).void
1161
+ end
1162
+ attr_writer :tool
1163
+
1164
+ # Node kind discriminator. Always `tool` for a tool node.
1165
+ sig do
1166
+ returns(
1167
+ T.nilable(
1168
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::TaggedSymbol
1169
+ )
1170
+ )
1171
+ end
1172
+ attr_reader :type
1173
+
1174
+ sig do
1175
+ params(
1176
+ type:
1177
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::OrSymbol
1178
+ ).void
1179
+ end
1180
+ attr_writer :type
1181
+
1182
+ # A standalone tool step in a conversation flow, as returned by the API.
1183
+ sig do
1184
+ params(
1185
+ id: String,
1186
+ shared_tool_id: String,
1187
+ name: String,
1188
+ position:
1189
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position::OrHash,
1190
+ tool:
1191
+ T::Array[
1192
+ T.any(
1193
+ Telnyx::AI::InferenceEmbeddingWebhookToolParams::OrHash,
1194
+ Telnyx::AI::RetrievalTool::OrHash,
1195
+ Telnyx::AI::AssistantTool::Handoff::OrHash,
1196
+ Telnyx::AI::HangupTool::OrHash,
1197
+ Telnyx::AI::AssistantTool::Transfer::OrHash,
1198
+ Telnyx::AI::AssistantTool::Invite::OrHash,
1199
+ Telnyx::AI::AssistantTool::Refer::OrHash,
1200
+ Telnyx::AI::AssistantTool::SendDtmf::OrHash,
1201
+ Telnyx::AI::AssistantTool::SendMessage::OrHash,
1202
+ Telnyx::AI::AssistantTool::SkipTurn::OrHash
1203
+ )
1204
+ ],
1205
+ type:
1206
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::OrSymbol
1207
+ ).returns(T.attached_class)
1208
+ end
1209
+ def self.new(
1210
+ # Caller-supplied unique identifier for this node within the flow.
1211
+ id:,
1212
+ # ID of the single shared (org-level) tool this node executes. When the flow
1213
+ # reaches this node the tool runs as a deliberate step (no LLM turn); its outgoing
1214
+ # `tool_result` edges then route on the outcome. Arguments are filled from the
1215
+ # conversation's dynamic variables by name — a dynamic variable whose name matches
1216
+ # one of the tool's parameters supplies that argument. Cross-validated against the
1217
+ # org's shared tools on write.
1218
+ shared_tool_id:,
1219
+ # Optional human-readable label, displayed in authoring UIs.
1220
+ name: nil,
1221
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
1222
+ # by the runtime; round-trips so frontends can persist graph layout across
1223
+ # reloads.
1224
+ position: nil,
1225
+ # Full tool definition resolved from `shared_tool_id` server-side. Populated on
1226
+ # responses so clients can render the node without a follow-up fetch. Ignored on
1227
+ # input — set `shared_tool_id`.
1228
+ tool: nil,
1229
+ # Node kind discriminator. Always `tool` for a tool node.
1230
+ type: nil
1231
+ )
1232
+ end
1233
+
1234
+ sig do
1235
+ override.returns(
1236
+ {
1237
+ id: String,
1238
+ shared_tool_id: String,
1239
+ name: String,
1240
+ position:
1241
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position,
1242
+ tool: T::Array[Telnyx::AI::AssistantTool::Variants],
1243
+ type:
1244
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::TaggedSymbol
1245
+ }
1246
+ )
1247
+ end
1248
+ def to_hash
1249
+ end
1250
+
1251
+ class Position < Telnyx::Internal::Type::BaseModel
1252
+ OrHash =
1253
+ T.type_alias do
1254
+ T.any(
1255
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Position,
1256
+ Telnyx::Internal::AnyHash
1257
+ )
1258
+ end
1259
+
1260
+ # Horizontal coordinate in the authoring canvas.
1261
+ sig { returns(Float) }
1262
+ attr_accessor :x
1263
+
1264
+ # Vertical coordinate in the authoring canvas.
1265
+ sig { returns(Float) }
1266
+ attr_accessor :y_
1267
+
1268
+ # Optional canvas coordinates used by authoring UIs to lay out the graph. Ignored
1269
+ # by the runtime; round-trips so frontends can persist graph layout across
1270
+ # reloads.
1271
+ sig { params(x: Float, y_: Float).returns(T.attached_class) }
1272
+ def self.new(
1273
+ # Horizontal coordinate in the authoring canvas.
1274
+ x:,
1275
+ # Vertical coordinate in the authoring canvas.
1276
+ y_:
1277
+ )
1278
+ end
1279
+
1280
+ sig { override.returns({ x: Float, y_: Float }) }
1281
+ def to_hash
1282
+ end
1283
+ end
1284
+
1285
+ # Node kind discriminator. Always `tool` for a tool node.
1286
+ module Type
1287
+ extend Telnyx::Internal::Type::Enum
1288
+
1289
+ TaggedSymbol =
1290
+ T.type_alias do
1291
+ T.all(
1292
+ Symbol,
1293
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type
1294
+ )
1295
+ end
1296
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1297
+
1298
+ TOOL =
1299
+ T.let(
1300
+ :tool,
1301
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::TaggedSymbol
1302
+ )
1303
+
1304
+ sig do
1305
+ override.returns(
1306
+ T::Array[
1307
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Tool::Type::TaggedSymbol
1308
+ ]
1309
+ )
1310
+ end
1311
+ def self.values
1312
+ end
1313
+ end
1314
+ end
1315
+
1316
+ sig do
1317
+ override.returns(
1318
+ T::Array[
1319
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Node::Variants
1320
+ ]
1321
+ )
1322
+ end
1323
+ def self.variants
1324
+ end
1325
+ end
1326
+
1327
+ class Edge < Telnyx::Internal::Type::BaseModel
1328
+ OrHash =
1329
+ T.type_alias do
1330
+ T.any(
1331
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge,
1332
+ Telnyx::Internal::AnyHash
1333
+ )
1334
+ end
1335
+
1336
+ # Caller-supplied unique identifier for this edge within the flow.
1337
+ sig { returns(String) }
1338
+ attr_accessor :id
1339
+
1340
+ # Condition that gates the transition. Discriminated by `type`: `llm`,
1341
+ # `expression`.
1342
+ sig do
1343
+ returns(
1344
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Variants
1345
+ )
1346
+ end
1347
+ attr_accessor :condition
1348
+
1349
+ # ID of the node this edge transitions away from.
1350
+ sig { returns(String) }
1351
+ attr_accessor :start_node_id
1352
+
1353
+ # Destination of the transition. Discriminated by `type`: `node` (jump to another
1354
+ # node in this flow) or `assistant` (hand off to a different assistant).
1355
+ sig do
1356
+ returns(
1357
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Variants
1358
+ )
1359
+ end
1360
+ attr_accessor :target
1361
+
1362
+ # Directed transition from one node to a target, gated by a condition.
1363
+ #
1364
+ # The target is either another node in the same flow (`NodeTarget`) or a different
1365
+ # assistant (`AssistantTarget`). Multiple edges may share a `start_node_id`; the
1366
+ # runtime evaluates them in the order they're declared and takes the first whose
1367
+ # condition is true.
1368
+ sig do
1369
+ params(
1370
+ id: String,
1371
+ condition:
1372
+ T.any(
1373
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm::OrHash,
1374
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::OrHash
1375
+ ),
1376
+ start_node_id: String,
1377
+ target:
1378
+ T.any(
1379
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node::OrHash,
1380
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::OrHash
1381
+ )
1382
+ ).returns(T.attached_class)
1383
+ end
1384
+ def self.new(
1385
+ # Caller-supplied unique identifier for this edge within the flow.
1386
+ id:,
1387
+ # Condition that gates the transition. Discriminated by `type`: `llm`,
1388
+ # `expression`.
1389
+ condition:,
1390
+ # ID of the node this edge transitions away from.
1391
+ start_node_id:,
1392
+ # Destination of the transition. Discriminated by `type`: `node` (jump to another
1393
+ # node in this flow) or `assistant` (hand off to a different assistant).
1394
+ target:
1395
+ )
1396
+ end
1397
+
1398
+ sig do
1399
+ override.returns(
1400
+ {
1401
+ id: String,
1402
+ condition:
1403
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Variants,
1404
+ start_node_id: String,
1405
+ target:
1406
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Variants
1407
+ }
1408
+ )
1409
+ end
1410
+ def to_hash
1411
+ end
1412
+
1413
+ # Condition that gates the transition. Discriminated by `type`: `llm`,
1414
+ # `expression`.
1415
+ module Condition
1416
+ extend Telnyx::Internal::Type::Union
1417
+
1418
+ Variants =
1419
+ T.type_alias do
1420
+ T.any(
1421
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm,
1422
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression
1423
+ )
1424
+ end
1425
+
1426
+ class Llm < Telnyx::Internal::Type::BaseModel
1427
+ OrHash =
1428
+ T.type_alias do
1429
+ T.any(
1430
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Llm,
1431
+ Telnyx::Internal::AnyHash
1432
+ )
1433
+ end
1434
+
1435
+ # Natural-language criterion the LLM judges as true/false.
1436
+ sig { returns(String) }
1437
+ attr_accessor :prompt
1438
+
1439
+ sig { returns(Symbol) }
1440
+ attr_accessor :type
1441
+
1442
+ # Edge condition evaluated by the LLM from a natural-language prompt.
1443
+ #
1444
+ # The model is asked to judge the prompt against conversation context and returns
1445
+ # true/false. Use this for fuzzy intents that aren't expressible as a
1446
+ # deterministic expression (e.g. 'user wants to escalate to a human').
1447
+ sig do
1448
+ params(prompt: String, type: Symbol).returns(T.attached_class)
1449
+ end
1450
+ def self.new(
1451
+ # Natural-language criterion the LLM judges as true/false.
1452
+ prompt:,
1453
+ type: :llm
1454
+ )
1455
+ end
1456
+
1457
+ sig { override.returns({ prompt: String, type: Symbol }) }
1458
+ def to_hash
1459
+ end
1460
+ end
1461
+
1462
+ class Expression < Telnyx::Internal::Type::BaseModel
1463
+ OrHash =
1464
+ T.type_alias do
1465
+ T.any(
1466
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression,
1467
+ Telnyx::Internal::AnyHash
1468
+ )
1469
+ end
1470
+
1471
+ # A node in a deterministic expression AST. Exactly one variant is selected by the
1472
+ # `type` discriminator. Terminal variants (`number_literal`, `string_literal`,
1473
+ # `bool_literal`, `variable`) bottom out the recursion; `arithmetic`, `bool_op`,
1474
+ # and `comparison` nest further sub-expressions.
1475
+ #
1476
+ # Extracted into a single named schema so the recursive union is defined once (was
1477
+ # previously inlined at every operand site).
1478
+ sig do
1479
+ returns(
1480
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::Variants
1481
+ )
1482
+ end
1483
+ attr_accessor :expression
1484
+
1485
+ sig { returns(Symbol) }
1486
+ attr_accessor :type
1487
+
1488
+ # Edge condition evaluated as a deterministic expression AST.
1489
+ #
1490
+ # The expression is computed against runtime dynamic variables and must evaluate
1491
+ # to a boolean. Prefer this over `LLMCondition` when the rule is a clean function
1492
+ # of known variables — it's cheaper and predictable.
1493
+ sig do
1494
+ params(
1495
+ expression:
1496
+ T.any(
1497
+ T.anything,
1498
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression::OrHash,
1499
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression::OrHash,
1500
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression::OrHash,
1501
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression::OrHash
1502
+ ),
1503
+ type: Symbol
1504
+ ).returns(T.attached_class)
1505
+ end
1506
+ def self.new(
1507
+ # A node in a deterministic expression AST. Exactly one variant is selected by the
1508
+ # `type` discriminator. Terminal variants (`number_literal`, `string_literal`,
1509
+ # `bool_literal`, `variable`) bottom out the recursion; `arithmetic`, `bool_op`,
1510
+ # and `comparison` nest further sub-expressions.
1511
+ #
1512
+ # Extracted into a single named schema so the recursive union is defined once (was
1513
+ # previously inlined at every operand site).
1514
+ expression:,
1515
+ type: :expression
1516
+ )
1517
+ end
1518
+
1519
+ sig do
1520
+ override.returns(
1521
+ {
1522
+ expression:
1523
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::Variants,
1524
+ type: Symbol
1525
+ }
1526
+ )
1527
+ end
1528
+ def to_hash
1529
+ end
1530
+
1531
+ # A node in a deterministic expression AST. Exactly one variant is selected by the
1532
+ # `type` discriminator. Terminal variants (`number_literal`, `string_literal`,
1533
+ # `bool_literal`, `variable`) bottom out the recursion; `arithmetic`, `bool_op`,
1534
+ # and `comparison` nest further sub-expressions.
1535
+ #
1536
+ # Extracted into a single named schema so the recursive union is defined once (was
1537
+ # previously inlined at every operand site).
1538
+ module Expression
1539
+ extend Telnyx::Internal::Type::Union
1540
+
1541
+ Variants =
1542
+ T.type_alias do
1543
+ T.any(
1544
+ T.anything,
1545
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression,
1546
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression,
1547
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression,
1548
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression
1549
+ )
1550
+ end
1551
+
1552
+ class DynamicVariableExpression < Telnyx::Internal::Type::BaseModel
1553
+ OrHash =
1554
+ T.type_alias do
1555
+ T.any(
1556
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::DynamicVariableExpression,
1557
+ Telnyx::Internal::AnyHash
1558
+ )
1559
+ end
1560
+
1561
+ # Variable name to look up in the runtime context.
1562
+ sig { returns(String) }
1563
+ attr_accessor :name
1564
+
1565
+ sig { returns(Symbol) }
1566
+ attr_accessor :type
1567
+
1568
+ # Reference a dynamic variable by name.
1569
+ #
1570
+ # Resolved at runtime from the assistant's dynamic-variables context (see
1571
+ # `Assistant.dynamic_variables` and the dynamic-variables webhook).
1572
+ sig do
1573
+ params(name: String, type: Symbol).returns(
1574
+ T.attached_class
1575
+ )
1576
+ end
1577
+ def self.new(
1578
+ # Variable name to look up in the runtime context.
1579
+ name:,
1580
+ type: :variable
1581
+ )
1582
+ end
1583
+
1584
+ sig { override.returns({ name: String, type: Symbol }) }
1585
+ def to_hash
1586
+ end
1587
+ end
1588
+
1589
+ class StringLiteralExpression < Telnyx::Internal::Type::BaseModel
1590
+ OrHash =
1591
+ T.type_alias do
1592
+ T.any(
1593
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::StringLiteralExpression,
1594
+ Telnyx::Internal::AnyHash
1595
+ )
1596
+ end
1597
+
1598
+ sig { returns(Symbol) }
1599
+ attr_accessor :type
1600
+
1601
+ # Literal string value.
1602
+ sig { returns(String) }
1603
+ attr_accessor :value
1604
+
1605
+ # Constant string value.
1606
+ sig do
1607
+ params(value: String, type: Symbol).returns(
1608
+ T.attached_class
1609
+ )
1610
+ end
1611
+ def self.new(
1612
+ # Literal string value.
1613
+ value:,
1614
+ type: :string_literal
1615
+ )
1616
+ end
1617
+
1618
+ sig { override.returns({ type: Symbol, value: String }) }
1619
+ def to_hash
1620
+ end
1621
+ end
1622
+
1623
+ class NumberLiteralExpression < Telnyx::Internal::Type::BaseModel
1624
+ OrHash =
1625
+ T.type_alias do
1626
+ T.any(
1627
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::NumberLiteralExpression,
1628
+ Telnyx::Internal::AnyHash
1629
+ )
1630
+ end
1631
+
1632
+ sig { returns(Symbol) }
1633
+ attr_accessor :type
1634
+
1635
+ # Literal numeric value.
1636
+ sig { returns(Float) }
1637
+ attr_accessor :value
1638
+
1639
+ # Constant numeric value (float; integers are accepted and stored as float).
1640
+ sig do
1641
+ params(value: Float, type: Symbol).returns(
1642
+ T.attached_class
1643
+ )
1644
+ end
1645
+ def self.new(
1646
+ # Literal numeric value.
1647
+ value:,
1648
+ type: :number_literal
1649
+ )
1650
+ end
1651
+
1652
+ sig { override.returns({ type: Symbol, value: Float }) }
1653
+ def to_hash
1654
+ end
1655
+ end
1656
+
1657
+ class BooleanLiteralExpression < Telnyx::Internal::Type::BaseModel
1658
+ OrHash =
1659
+ T.type_alias do
1660
+ T.any(
1661
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::BooleanLiteralExpression,
1662
+ Telnyx::Internal::AnyHash
1663
+ )
1664
+ end
1665
+
1666
+ sig { returns(Symbol) }
1667
+ attr_accessor :type
1668
+
1669
+ # Literal boolean value.
1670
+ sig { returns(T::Boolean) }
1671
+ attr_accessor :value
1672
+
1673
+ # Constant boolean value. Useful for unconditional ('always') edges.
1674
+ sig do
1675
+ params(value: T::Boolean, type: Symbol).returns(
1676
+ T.attached_class
1677
+ )
1678
+ end
1679
+ def self.new(
1680
+ # Literal boolean value.
1681
+ value:,
1682
+ type: :bool_literal
1683
+ )
1684
+ end
1685
+
1686
+ sig do
1687
+ override.returns({ type: Symbol, value: T::Boolean })
1688
+ end
1689
+ def to_hash
1690
+ end
1691
+ end
1692
+
1693
+ sig do
1694
+ override.returns(
1695
+ T::Array[
1696
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Expression::Expression::Variants
1697
+ ]
1698
+ )
1699
+ end
1700
+ def self.variants
1701
+ end
1702
+ end
1703
+ end
1704
+
1705
+ sig do
1706
+ override.returns(
1707
+ T::Array[
1708
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Condition::Variants
1709
+ ]
1710
+ )
1711
+ end
1712
+ def self.variants
1713
+ end
1714
+ end
1715
+
1716
+ # Destination of the transition. Discriminated by `type`: `node` (jump to another
1717
+ # node in this flow) or `assistant` (hand off to a different assistant).
1718
+ module Target
1719
+ extend Telnyx::Internal::Type::Union
1720
+
1721
+ Variants =
1722
+ T.type_alias do
1723
+ T.any(
1724
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node,
1725
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant
1726
+ )
1727
+ end
1728
+
1729
+ class Node < Telnyx::Internal::Type::BaseModel
1730
+ OrHash =
1731
+ T.type_alias do
1732
+ T.any(
1733
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Node,
1734
+ Telnyx::Internal::AnyHash
1735
+ )
1736
+ end
1737
+
1738
+ # ID of the node this edge transitions into.
1739
+ sig { returns(String) }
1740
+ attr_accessor :node_id
1741
+
1742
+ sig { returns(Symbol) }
1743
+ attr_accessor :type
1744
+
1745
+ # Edge target referencing another node within the same flow.
1746
+ #
1747
+ # The runtime transitions the active node to `node_id` and continues processing
1748
+ # within the current assistant's flow.
1749
+ sig do
1750
+ params(node_id: String, type: Symbol).returns(
1751
+ T.attached_class
1752
+ )
1753
+ end
1754
+ def self.new(
1755
+ # ID of the node this edge transitions into.
1756
+ node_id:,
1757
+ type: :node
1758
+ )
1759
+ end
1760
+
1761
+ sig { override.returns({ node_id: String, type: Symbol }) }
1762
+ def to_hash
1763
+ end
1764
+ end
1765
+
1766
+ class Assistant < Telnyx::Internal::Type::BaseModel
1767
+ OrHash =
1768
+ T.type_alias do
1769
+ T.any(
1770
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant,
1771
+ Telnyx::Internal::AnyHash
1772
+ )
1773
+ end
1774
+
1775
+ # ID of the assistant the conversation transitions to.
1776
+ sig { returns(String) }
1777
+ attr_accessor :assistant_id
1778
+
1779
+ sig { returns(Symbol) }
1780
+ attr_accessor :type
1781
+
1782
+ # Optional canvas coordinates for rendering the target assistant as a node in
1783
+ # authoring UIs. Pure presentation — the runtime ignores it; round-trips so
1784
+ # frontends can persist graph layout across reloads. When multiple edges target
1785
+ # the same assistant, each edge's `position` is independent (frontends typically
1786
+ # use the first non-null one).
1787
+ sig do
1788
+ returns(
1789
+ T.nilable(
1790
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position
1791
+ )
1792
+ )
1793
+ end
1794
+ attr_reader :position
1795
+
1796
+ sig do
1797
+ params(
1798
+ position:
1799
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position::OrHash
1800
+ ).void
1801
+ end
1802
+ attr_writer :position
1803
+
1804
+ # Voice behavior when handing off to the target assistant, mirroring the handoff
1805
+ # tool's `voice_mode`. `unified` (default) keeps the current voice across the
1806
+ # handoff; `distinct` lets the target assistant speak with its own configured
1807
+ # voice. Only applies to assistant targets — node targets override voice via the
1808
+ # node's own `voice_settings`.
1809
+ sig do
1810
+ returns(
1811
+ T.nilable(
1812
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::TaggedSymbol
1813
+ )
1814
+ )
1815
+ end
1816
+ attr_reader :voice_mode
1817
+
1818
+ sig do
1819
+ params(
1820
+ voice_mode:
1821
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::OrSymbol
1822
+ ).void
1823
+ end
1824
+ attr_writer :voice_mode
1825
+
1826
+ # Edge target referencing a different assistant.
1827
+ #
1828
+ # When the edge fires, the conversation hands off to `assistant_id`: the active
1829
+ # assistant on the conversation row is rewritten and the new assistant's flow
1830
+ # starts at its own `start_node_id`. The current turn's LLM response is delivered
1831
+ # to the user as-is; subsequent turns route to the new assistant.
1832
+ sig do
1833
+ params(
1834
+ assistant_id: String,
1835
+ position:
1836
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position::OrHash,
1837
+ voice_mode:
1838
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::OrSymbol,
1839
+ type: Symbol
1840
+ ).returns(T.attached_class)
1841
+ end
1842
+ def self.new(
1843
+ # ID of the assistant the conversation transitions to.
1844
+ assistant_id:,
1845
+ # Optional canvas coordinates for rendering the target assistant as a node in
1846
+ # authoring UIs. Pure presentation — the runtime ignores it; round-trips so
1847
+ # frontends can persist graph layout across reloads. When multiple edges target
1848
+ # the same assistant, each edge's `position` is independent (frontends typically
1849
+ # use the first non-null one).
1850
+ position: nil,
1851
+ # Voice behavior when handing off to the target assistant, mirroring the handoff
1852
+ # tool's `voice_mode`. `unified` (default) keeps the current voice across the
1853
+ # handoff; `distinct` lets the target assistant speak with its own configured
1854
+ # voice. Only applies to assistant targets — node targets override voice via the
1855
+ # node's own `voice_settings`.
1856
+ voice_mode: nil,
1857
+ type: :assistant
1858
+ )
1859
+ end
1860
+
1861
+ sig do
1862
+ override.returns(
1863
+ {
1864
+ assistant_id: String,
1865
+ type: Symbol,
1866
+ position:
1867
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position,
1868
+ voice_mode:
1869
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::TaggedSymbol
1870
+ }
1871
+ )
1872
+ end
1873
+ def to_hash
1874
+ end
1875
+
1876
+ class Position < Telnyx::Internal::Type::BaseModel
1877
+ OrHash =
1878
+ T.type_alias do
1879
+ T.any(
1880
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::Position,
1881
+ Telnyx::Internal::AnyHash
1882
+ )
1883
+ end
1884
+
1885
+ # Horizontal coordinate in the authoring canvas.
1886
+ sig { returns(Float) }
1887
+ attr_accessor :x
1888
+
1889
+ # Vertical coordinate in the authoring canvas.
1890
+ sig { returns(Float) }
1891
+ attr_accessor :y_
1892
+
1893
+ # Optional canvas coordinates for rendering the target assistant as a node in
1894
+ # authoring UIs. Pure presentation — the runtime ignores it; round-trips so
1895
+ # frontends can persist graph layout across reloads. When multiple edges target
1896
+ # the same assistant, each edge's `position` is independent (frontends typically
1897
+ # use the first non-null one).
1898
+ sig { params(x: Float, y_: Float).returns(T.attached_class) }
1899
+ def self.new(
1900
+ # Horizontal coordinate in the authoring canvas.
1901
+ x:,
1902
+ # Vertical coordinate in the authoring canvas.
1903
+ y_:
1904
+ )
1905
+ end
1906
+
1907
+ sig { override.returns({ x: Float, y_: Float }) }
1908
+ def to_hash
1909
+ end
1910
+ end
1911
+
1912
+ # Voice behavior when handing off to the target assistant, mirroring the handoff
1913
+ # tool's `voice_mode`. `unified` (default) keeps the current voice across the
1914
+ # handoff; `distinct` lets the target assistant speak with its own configured
1915
+ # voice. Only applies to assistant targets — node targets override voice via the
1916
+ # node's own `voice_settings`.
1917
+ module VoiceMode
1918
+ extend Telnyx::Internal::Type::Enum
1919
+
1920
+ TaggedSymbol =
1921
+ T.type_alias do
1922
+ T.all(
1923
+ Symbol,
1924
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode
1925
+ )
1926
+ end
1927
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1928
+
1929
+ UNIFIED =
1930
+ T.let(
1931
+ :unified,
1932
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::TaggedSymbol
1933
+ )
1934
+ DISTINCT =
1935
+ T.let(
1936
+ :distinct,
1937
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::TaggedSymbol
1938
+ )
1939
+
1940
+ sig do
1941
+ override.returns(
1942
+ T::Array[
1943
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Assistant::VoiceMode::TaggedSymbol
1944
+ ]
1945
+ )
1946
+ end
1947
+ def self.values
1948
+ end
1949
+ end
1950
+ end
1951
+
1952
+ sig do
1953
+ override.returns(
1954
+ T::Array[
1955
+ Telnyx::AI::InferenceEmbedding::ConversationFlow::Edge::Target::Variants
1956
+ ]
1957
+ )
1958
+ end
1959
+ def self.variants
1960
+ end
1961
+ end
1962
+ end
1963
+ end
510
1964
  end
511
1965
  end
512
1966
  end