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