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