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