telnyx 5.70.0 → 5.72.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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/lib/webhook_verification.rb +14 -1
  5. data/lib/telnyx/lib/webhooks_ed25519.rb +51 -38
  6. data/lib/telnyx/lib.rb +14 -0
  7. data/lib/telnyx/models/ai/assistant.rb +6 -149
  8. data/lib/telnyx/models/book_appointment_tool.rb +31 -0
  9. data/lib/telnyx/models/book_appointment_tool_params.rb +51 -0
  10. data/lib/telnyx/models/call_assistant_request.rb +176 -0
  11. data/lib/telnyx/models/call_control_bucket_ids.rb +23 -0
  12. data/lib/telnyx/models/call_control_retrieval_tool.rb +31 -0
  13. data/lib/telnyx/models/call_dial_params.rb +11 -1
  14. data/lib/telnyx/models/calls/action_answer_params.rb +11 -1
  15. data/lib/telnyx/models/calls/action_start_ai_assistant_params.rb +6 -39
  16. data/lib/telnyx/models/check_availability_tool.rb +31 -0
  17. data/lib/telnyx/models/check_availability_tool_params.rb +31 -0
  18. data/lib/telnyx/models/pronunciation_dict_alias_item.rb +51 -0
  19. data/lib/telnyx/models/pronunciation_dict_create_params.rb +5 -93
  20. data/lib/telnyx/models/pronunciation_dict_create_response.rb +3 -191
  21. data/lib/telnyx/models/pronunciation_dict_data.rb +101 -0
  22. data/lib/telnyx/models/pronunciation_dict_phoneme_item.rb +71 -0
  23. data/lib/telnyx/models/pronunciation_dict_retrieve_response.rb +3 -191
  24. data/lib/telnyx/models/pronunciation_dict_update_params.rb +5 -93
  25. data/lib/telnyx/models/pronunciation_dict_update_response.rb +3 -191
  26. data/lib/telnyx/models/texml/accounts/call_calls_params.rb +203 -191
  27. data/lib/telnyx/models/voice_clone_create_from_design_params.rb +3 -3
  28. data/lib/telnyx/models/voice_clone_create_from_upload_params.rb +61 -54
  29. data/lib/telnyx/models/voice_clone_create_params.rb +28 -28
  30. data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rb +26 -0
  31. data/lib/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rb +54 -0
  32. data/lib/telnyx/models.rb +20 -0
  33. data/lib/telnyx/resources/calls/actions.rb +4 -2
  34. data/lib/telnyx/resources/calls.rb +3 -1
  35. data/lib/telnyx/resources/pronunciation_dicts.rb +4 -4
  36. data/lib/telnyx/resources/texml/accounts/calls.rb +3 -3
  37. data/lib/telnyx/resources/voice_clones.rb +6 -6
  38. data/lib/telnyx/resources/whatsapp/phone_numbers/profile/photo.rb +20 -0
  39. data/lib/telnyx/version.rb +1 -1
  40. data/lib/telnyx.rb +16 -1
  41. data/rbi/telnyx/models/ai/assistant.rbi +15 -329
  42. data/rbi/telnyx/models/book_appointment_tool.rbi +65 -0
  43. data/rbi/telnyx/models/book_appointment_tool_params.rbi +83 -0
  44. data/rbi/telnyx/models/call_assistant_request.rbi +322 -0
  45. data/rbi/telnyx/models/call_control_bucket_ids.rbi +42 -0
  46. data/rbi/telnyx/models/call_control_retrieval_tool.rbi +63 -0
  47. data/rbi/telnyx/models/call_dial_params.rbi +15 -0
  48. data/rbi/telnyx/models/calls/action_answer_params.rbi +15 -0
  49. data/rbi/telnyx/models/calls/action_start_ai_assistant_params.rbi +10 -77
  50. data/rbi/telnyx/models/check_availability_tool.rbi +67 -0
  51. data/rbi/telnyx/models/check_availability_tool_params.rbi +45 -0
  52. data/rbi/telnyx/models/pronunciation_dict_alias_item.rbi +79 -0
  53. data/rbi/telnyx/models/pronunciation_dict_create_params.rbi +8 -154
  54. data/rbi/telnyx/models/pronunciation_dict_create_response.rbi +6 -366
  55. data/rbi/telnyx/models/pronunciation_dict_data.rbi +186 -0
  56. data/rbi/telnyx/models/pronunciation_dict_phoneme_item.rbi +117 -0
  57. data/rbi/telnyx/models/pronunciation_dict_retrieve_response.rbi +6 -366
  58. data/rbi/telnyx/models/pronunciation_dict_update_params.rbi +10 -156
  59. data/rbi/telnyx/models/pronunciation_dict_update_response.rbi +6 -366
  60. data/rbi/telnyx/models/texml/accounts/call_calls_params.rbi +391 -403
  61. data/rbi/telnyx/models/voice_clone_create_from_design_params.rbi +10 -10
  62. data/rbi/telnyx/models/voice_clone_create_from_upload_params.rbi +94 -92
  63. data/rbi/telnyx/models/voice_clone_create_params.rbi +53 -53
  64. data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbi +47 -0
  65. data/rbi/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbi +118 -0
  66. data/rbi/telnyx/models.rbi +20 -0
  67. data/rbi/telnyx/resources/calls/actions.rbi +9 -3
  68. data/rbi/telnyx/resources/calls.rbi +5 -0
  69. data/rbi/telnyx/resources/pronunciation_dicts.rbi +5 -7
  70. data/rbi/telnyx/resources/texml/accounts/calls.rbi +5 -5
  71. data/rbi/telnyx/resources/voice_clones.rbi +9 -9
  72. data/rbi/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbi +16 -0
  73. data/sig/telnyx/models/ai/assistant.rbs +3 -142
  74. data/sig/telnyx/models/book_appointment_tool.rbs +35 -0
  75. data/sig/telnyx/models/book_appointment_tool_params.rbs +39 -0
  76. data/sig/telnyx/models/call_assistant_request.rbs +132 -0
  77. data/sig/telnyx/models/call_control_bucket_ids.rbs +21 -0
  78. data/sig/telnyx/models/call_control_retrieval_tool.rbs +35 -0
  79. data/sig/telnyx/models/call_dial_params.rbs +9 -0
  80. data/sig/telnyx/models/calls/action_answer_params.rbs +9 -0
  81. data/sig/telnyx/models/calls/action_start_ai_assistant_params.rbs +6 -35
  82. data/sig/telnyx/models/check_availability_tool.rbs +35 -0
  83. data/sig/telnyx/models/check_availability_tool_params.rbs +16 -0
  84. data/sig/telnyx/models/pronunciation_dict_alias_item.rbs +40 -0
  85. data/sig/telnyx/models/pronunciation_dict_create_params.rbs +2 -58
  86. data/sig/telnyx/models/pronunciation_dict_create_response.rbs +6 -155
  87. data/sig/telnyx/models/pronunciation_dict_data.rbs +88 -0
  88. data/sig/telnyx/models/pronunciation_dict_phoneme_item.rbs +55 -0
  89. data/sig/telnyx/models/pronunciation_dict_retrieve_response.rbs +6 -155
  90. data/sig/telnyx/models/pronunciation_dict_update_params.rbs +2 -58
  91. data/sig/telnyx/models/pronunciation_dict_update_response.rbs +6 -155
  92. data/sig/telnyx/models/texml/accounts/call_calls_params.rbs +317 -325
  93. data/sig/telnyx/models/voice_clone_create_from_design_params.rbs +7 -7
  94. data/sig/telnyx/models/voice_clone_create_from_upload_params.rbs +63 -61
  95. data/sig/telnyx/models/voice_clone_create_params.rbs +35 -35
  96. data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_params.rbs +30 -0
  97. data/sig/telnyx/models/whatsapp/phone_numbers/profile/photo_retrieve_response.rbs +63 -0
  98. data/sig/telnyx/models.rbs +20 -0
  99. data/sig/telnyx/resources/calls/actions.rbs +2 -1
  100. data/sig/telnyx/resources/calls.rbs +1 -0
  101. data/sig/telnyx/resources/pronunciation_dicts.rbs +1 -1
  102. data/sig/telnyx/resources/texml/accounts/calls.rbs +1 -1
  103. data/sig/telnyx/resources/voice_clones.rbs +2 -2
  104. data/sig/telnyx/resources/whatsapp/phone_numbers/profile/photo.rbs +5 -0
  105. metadata +39 -5
  106. data/lib/telnyx/models/pronunciation_dict_list_response.rb +0 -190
  107. data/rbi/telnyx/models/pronunciation_dict_list_response.rbi +0 -353
  108. data/sig/telnyx/models/pronunciation_dict_list_response.rbs +0 -144
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ac9a07c8a853ece2ee38dc9271bc8aede4cdc909f634b11f547d24a01906726
4
- data.tar.gz: 6ad873c682fd93b981dbca7a48f83bef3c1b43e29a6722c2e72bf46f6b20b79a
3
+ metadata.gz: d4b500a4bc4109025ba78f82c49404d3013e7503c76f1d9c8634b3acafbab842
4
+ data.tar.gz: 10cf9319219e298027dc388a87825bd3edd259ffdeead4f22296ed2a69c6a0e2
5
5
  SHA512:
6
- metadata.gz: 7cd372e02874a4654b037003c200e382104128701fb6e521882853e81a7671d6faa00e51e8dc28f9d58f69a38a2edcbcb1c473642e1ddcf979d6cf9718aaf3c9
7
- data.tar.gz: 71b0c0af94329048ed0920882d23d0cd41c8e5d231e7004de41196dc05f08c1231ce8ec3a4e6f8f4f4cae7a223a5c93a756acd68bcc4ea406844ac62b7c41f82
6
+ metadata.gz: b9f7f8f34ba648a1ec8309a25a958b2cfccb5e8f4f78753110353ba7795b5d82191d2939ce8bc7890f91b174875349ca89d7161cf11bc8171311c75c282e0724
7
+ data.tar.gz: 1ce14a74710071dabcf31b1c5046172211879613dfe534cadf77783cf66e696bf557a15ade2928eaf5de7f3aa6637c93d4b83b22c0f78bb738c2d36f842559c3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.72.0 (2026-04-11)
4
+
5
+ Full Changelog: [v5.71.0...v5.72.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.71.0...v5.72.0)
6
+
7
+ ### Features
8
+
9
+ * **lib:** make ED25519 the default webhook verification ([c281219](https://github.com/team-telnyx/telnyx-ruby/commit/c2812192677e731ddf6b6702590f7e55d2f3ef68))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * **lib:** move ED25519 auto-require to lib.rb entry point to survive codegen ([7f38f2c](https://github.com/team-telnyx/telnyx-ruby/commit/7f38f2cf33fb3c8391ce7d8f86c88513d7edc907))
15
+ * **lib:** update webhook tests for ED25519 default unwrap ([30ac4c7](https://github.com/team-telnyx/telnyx-ruby/commit/30ac4c7d1fc66732ba5dc55824d3876b4dd120f0))
16
+
17
+ ## 5.71.0 (2026-04-11)
18
+
19
+ Full Changelog: [v5.70.0...v5.71.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.70.0...v5.71.0)
20
+
21
+ ### Features
22
+
23
+ * add shared CallAssistantRequest schema for call-control assistant object ([67a2157](https://github.com/team-telnyx/telnyx-ruby/commit/67a2157455d5a6e5138f89e54479977f108605a7))
24
+ * **api:** manual updates ([0000b53](https://github.com/team-telnyx/telnyx-ruby/commit/0000b5378d0f1dfeb46f1b5670933819fa935d5a))
25
+ * **api:** Merge pull request [#46](https://github.com/team-telnyx/telnyx-ruby/issues/46) from stainless-sdks/FixModelRecommendation ([4b3ea59](https://github.com/team-telnyx/telnyx-ruby/commit/4b3ea599a86f9279f139cbb7868da79079685846))
26
+ * MSG-6846: add GET /profile/photo docs for whatsapp API ([d06a131](https://github.com/team-telnyx/telnyx-ruby/commit/d06a131d943549a7a744a3968e116480d986fc8e))
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * correct Provider constant reference in VoiceCloneCreateFromDesignParams RBI/RBS ([6c66dd2](https://github.com/team-telnyx/telnyx-ruby/commit/6c66dd2ebf03c26eeeadadb0a93f5828134d0492))
32
+
33
+
34
+ ### Reverts
35
+
36
+ * restore stainless.yml to pre-6a6df5b state ([d7e3266](https://github.com/team-telnyx/telnyx-ruby/commit/d7e3266c5593d4163184b2cdcff260aa281843d7))
37
+
38
+
39
+ ### Documentation
40
+
41
+ * improve examples ([ecc0d15](https://github.com/team-telnyx/telnyx-ruby/commit/ecc0d1599570e1bbeb73c2db47b05a3a9c0e7a00))
42
+
3
43
  ## 5.70.0 (2026-04-08)
4
44
 
5
45
  Full Changelog: [v5.69.0...v5.70.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.69.0...v5.70.0)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "telnyx", "~> 5.70.0"
27
+ gem "telnyx", "~> 5.72.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -150,7 +150,20 @@ module Telnyx
150
150
  # The raw 32-byte key needs to be wrapped in X.509 SubjectPublicKeyInfo format
151
151
  # ED25519 OID: 1.3.101.112 = 06 03 2b 65 70
152
152
  # X.509 SPKI header for ED25519: 30 2a 30 05 06 03 2b 65 70 03 21 00
153
- ed25519_spki_header = [0x30, 0x2a, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x70, 0x03, 0x21, 0x00].pack("C*")
153
+ ed25519_spki_header = [
154
+ 0x30,
155
+ 0x2a,
156
+ 0x30,
157
+ 0x05,
158
+ 0x06,
159
+ 0x03,
160
+ 0x2b,
161
+ 0x65,
162
+ 0x70,
163
+ 0x03,
164
+ 0x21,
165
+ 0x00
166
+ ].pack("C*")
154
167
  der_key = ed25519_spki_header + public_key_bytes
155
168
 
156
169
  begin
@@ -3,48 +3,61 @@
3
3
  require_relative "webhook_verification"
4
4
  require_relative "webhook_verification_error"
5
5
 
6
- module Telnyx
7
- module Resources
8
- # Extends the generated Webhooks class with ED25519 signature verification.
9
- #
10
- # This reopens the Webhooks class to include the WebhookVerification module,
11
- # which adds ED25519 signature verification matching Python, Node, Go, and Java SDKs.
12
- #
13
- # Usage:
14
- #
15
- # require "telnyx"
16
- # require "telnyx/lib/webhooks_ed25519"
17
- #
18
- # client = Telnyx::Client.new(
19
- # api_key: ENV["TELNYX_API_KEY"],
20
- # public_key: ENV["TELNYX_PUBLIC_KEY"] # Base64 from Mission Control
21
- # )
22
- #
23
- # # Verify signature only (raises WebhookVerificationError on failure)
24
- # client.webhooks.verify!(payload, headers)
25
- #
26
- # # Verify and parse (ED25519 verification, then parse)
27
- # event = client.webhooks.unwrap(payload, headers: headers)
28
- #
29
- class Webhooks
30
- include Telnyx::Lib::WebhookVerification
31
-
32
- # Override unwrap to use ED25519 verification instead of StandardWebhooks.
6
+ # Only apply the ED25519 override if the generated Webhooks class exists.
7
+ # This file is loaded after lib/telnyx/resources/webhooks.rb in the gem
8
+ # load order (see lib/telnyx.rb), so the class should always be defined.
9
+ if defined?(Telnyx::Resources::Webhooks)
10
+ module Telnyx
11
+ module Resources
12
+ # Extends the generated Webhooks class with ED25519 signature verification.
13
+ #
14
+ # This reopens the Webhooks class to include the WebhookVerification module,
15
+ # which adds ED25519 signature verification matching Python, Node, Go, and Java SDKs.
16
+ #
17
+ # Usage:
18
+ #
19
+ # require "telnyx"
20
+ # # ED25519 verification is now loaded by default — no extra require needed
33
21
  #
34
- # @param payload [String] The raw webhook payload as a string
35
- # @param headers [Hash{String=>String}] The raw HTTP headers
36
- # @param key [String, nil] Optional public key override (base64-encoded ED25519)
22
+ # client = Telnyx::Client.new(
23
+ # api_key: ENV["TELNYX_API_KEY"],
24
+ # public_key: ENV["TELNYX_PUBLIC_KEY"] # Base64 from Mission Control
25
+ # )
37
26
  #
38
- # @return [Telnyx::Models::UnwrapWebhookEvent]
39
- # @raise [Telnyx::Errors::WebhookVerificationError] If verification fails
40
- def unwrap(payload, headers:, key: nil)
41
- # Use ED25519 verification
42
- do_verify_signature(payload, headers, key || @client.public_key)
27
+ # # Verify signature only (raises WebhookVerificationError on failure)
28
+ # client.webhooks.verify!(payload, headers)
29
+ #
30
+ # # Verify and parse (ED25519 verification, then parse)
31
+ # event = client.webhooks.unwrap(payload, headers: headers)
32
+ #
33
+ class Webhooks
34
+ include Telnyx::Lib::WebhookVerification
35
+
36
+ # Override unwrap to use ED25519 verification instead of StandardWebhooks.
37
+ #
38
+ # @param payload [String] The raw webhook payload as a string
39
+ # @param headers [Hash{String=>String}] The raw HTTP headers
40
+ # @param key [String, nil] Optional public key override (base64-encoded ED25519)
41
+ #
42
+ # @return [Telnyx::Models::UnwrapWebhookEvent]
43
+ # @raise [Telnyx::Errors::WebhookVerificationError] If verification fails
44
+ def unwrap(payload, headers:, key: nil)
45
+ # Use ED25519 verification
46
+ do_verify_signature(payload, headers, key || @client.public_key)
43
47
 
44
- # Parse the payload
45
- parsed = JSON.parse(payload, symbolize_names: true)
46
- Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
48
+ # Parse the payload
49
+ parsed = JSON.parse(payload, symbolize_names: true)
50
+ Telnyx::Internal::Type::Converter.coerce(Telnyx::Models::UnwrapWebhookEvent, parsed)
51
+ end
47
52
  end
48
53
  end
49
54
  end
55
+ else
56
+ # If the generated Webhooks class isn't loaded yet, the ED25519 override
57
+ # can't be applied. This shouldn't happen in normal gem usage since
58
+ # lib/telnyx.rb loads resources before lib/. If you see this warning,
59
+ # ensure lib/telnyx.rb requires lib/telnyx/lib after the resources.
60
+ warn "[telnyx] ED25519 webhook verification not loaded: " \
61
+ "Telnyx::Resources::Webhooks is not defined. " \
62
+ "Check that lib/telnyx.rb loads resources before lib/telnyx/lib."
50
63
  end
data/lib/telnyx/lib.rb ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Custom lib entry point — preserved across Stainless codegen.
4
+ #
5
+ # This file requires all custom modules in lib/telnyx/lib/.
6
+ # It is loaded from lib/telnyx.rb (the gem entry point).
7
+ #
8
+ # If Stainless regenerates lib/telnyx.rb, the require_relative line
9
+ # pointing to this file must be re-added. All other custom code
10
+ # lives here and in lib/telnyx/lib/ — safe from codegen.
11
+ #
12
+ # Add new custom modules below:
13
+
14
+ require_relative "lib/webhooks_ed25519"
@@ -29,7 +29,7 @@ module Telnyx
29
29
  # @!attribute tools
30
30
  # The tools that the voice assistant can use.
31
31
  #
32
- # @return [Array<Telnyx::Models::AI::Assistant::Tool::BookAppointment, Telnyx::Models::AI::Assistant::Tool::CheckAvailability, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::AI::Assistant::Tool::Retrieval>, nil]
32
+ # @return [Array<Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool>, nil]
33
33
  optional :tools, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::AI::Assistant::Tool] }
34
34
 
35
35
  # @!method initialize(instructions: nil, model: nil, openai_api_key_ref: nil, tools: nil)
@@ -44,16 +44,16 @@ module Telnyx
44
44
  #
45
45
  # @param openai_api_key_ref [String] This is necessary only if the model selected is from OpenAI. You would pass the
46
46
  #
47
- # @param tools [Array<Telnyx::Models::AI::Assistant::Tool::BookAppointment, Telnyx::Models::AI::Assistant::Tool::CheckAvailability, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::AI::Assistant::Tool::Retrieval>] The tools that the voice assistant can use.
47
+ # @param tools [Array<Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool>] The tools that the voice assistant can use.
48
48
 
49
49
  module Tool
50
50
  extend Telnyx::Internal::Type::Union
51
51
 
52
52
  discriminator :type
53
53
 
54
- variant :book_appointment, -> { Telnyx::AI::Assistant::Tool::BookAppointment }
54
+ variant :book_appointment, -> { Telnyx::BookAppointmentTool }
55
55
 
56
- variant :check_availability, -> { Telnyx::AI::Assistant::Tool::CheckAvailability }
56
+ variant :check_availability, -> { Telnyx::CheckAvailabilityTool }
57
57
 
58
58
  variant :webhook, -> { Telnyx::AI::WebhookTool }
59
59
 
@@ -61,153 +61,10 @@ module Telnyx
61
61
 
62
62
  variant :transfer, -> { Telnyx::AI::TransferTool }
63
63
 
64
- variant :retrieval, -> { Telnyx::AI::Assistant::Tool::Retrieval }
65
-
66
- class BookAppointment < Telnyx::Internal::Type::BaseModel
67
- # @!attribute book_appointment
68
- #
69
- # @return [Telnyx::Models::AI::Assistant::Tool::BookAppointment::BookAppointment]
70
- required :book_appointment, -> { Telnyx::AI::Assistant::Tool::BookAppointment::BookAppointment }
71
-
72
- # @!attribute type
73
- #
74
- # @return [Symbol, :book_appointment]
75
- required :type, const: :book_appointment
76
-
77
- # @!method initialize(book_appointment:, type: :book_appointment)
78
- # @param book_appointment [Telnyx::Models::AI::Assistant::Tool::BookAppointment::BookAppointment]
79
- # @param type [Symbol, :book_appointment]
80
-
81
- # @see Telnyx::Models::AI::Assistant::Tool::BookAppointment#book_appointment
82
- class BookAppointment < Telnyx::Internal::Type::BaseModel
83
- # @!attribute api_key_ref
84
- # Reference to an integration secret that contains your Cal.com API key. You would
85
- # pass the `identifier` for an integration secret
86
- # [/v2/integration_secrets](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
87
- # that refers to your Cal.com API key.
88
- #
89
- # @return [String]
90
- required :api_key_ref, String
91
-
92
- # @!attribute event_type_id
93
- # Event Type ID for which slots are being fetched.
94
- # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-event-type-id)
95
- #
96
- # @return [Integer]
97
- required :event_type_id, Integer
98
-
99
- # @!attribute attendee_name
100
- # The name of the attendee
101
- # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee-name).
102
- # If not provided, the assistant will ask for the attendee's name.
103
- #
104
- # @return [String, nil]
105
- optional :attendee_name, String
106
-
107
- # @!attribute attendee_timezone
108
- # The timezone of the attendee
109
- # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee-timezone).
110
- # If not provided, the assistant will ask for the attendee's timezone.
111
- #
112
- # @return [String, nil]
113
- optional :attendee_timezone, String
114
-
115
- # @!method initialize(api_key_ref:, event_type_id:, attendee_name: nil, attendee_timezone: nil)
116
- # Some parameter documentations has been truncated, see
117
- # {Telnyx::Models::AI::Assistant::Tool::BookAppointment::BookAppointment} for more
118
- # details.
119
- #
120
- # @param api_key_ref [String] Reference to an integration secret that contains your Cal.com API key. You would
121
- #
122
- # @param event_type_id [Integer] Event Type ID for which slots are being fetched. [cal.com](https://cal.com/docs/
123
- #
124
- # @param attendee_name [String] The name of the attendee [cal.com](https://cal.com/docs/api-reference/v2/booking
125
- #
126
- # @param attendee_timezone [String] The timezone of the attendee [cal.com](https://cal.com/docs/api-reference/v2/boo
127
- end
128
- end
129
-
130
- class CheckAvailability < Telnyx::Internal::Type::BaseModel
131
- # @!attribute check_availability
132
- #
133
- # @return [Telnyx::Models::AI::Assistant::Tool::CheckAvailability::CheckAvailability]
134
- required :check_availability, -> { Telnyx::AI::Assistant::Tool::CheckAvailability::CheckAvailability }
135
-
136
- # @!attribute type
137
- #
138
- # @return [Symbol, :check_availability]
139
- required :type, const: :check_availability
140
-
141
- # @!method initialize(check_availability:, type: :check_availability)
142
- # @param check_availability [Telnyx::Models::AI::Assistant::Tool::CheckAvailability::CheckAvailability]
143
- # @param type [Symbol, :check_availability]
144
-
145
- # @see Telnyx::Models::AI::Assistant::Tool::CheckAvailability#check_availability
146
- class CheckAvailability < Telnyx::Internal::Type::BaseModel
147
- # @!attribute api_key_ref
148
- # Reference to an integration secret that contains your Cal.com API key. You would
149
- # pass the `identifier` for an integration secret
150
- # [/v2/integration_secrets](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
151
- # that refers to your Cal.com API key.
152
- #
153
- # @return [String]
154
- required :api_key_ref, String
155
-
156
- # @!attribute event_type_id
157
- # Event Type ID for which slots are being fetched.
158
- # [cal.com](https://cal.com/docs/api-reference/v2/slots/get-available-slots#parameter-event-type-id)
159
- #
160
- # @return [Integer]
161
- required :event_type_id, Integer
162
-
163
- # @!method initialize(api_key_ref:, event_type_id:)
164
- # Some parameter documentations has been truncated, see
165
- # {Telnyx::Models::AI::Assistant::Tool::CheckAvailability::CheckAvailability} for
166
- # more details.
167
- #
168
- # @param api_key_ref [String] Reference to an integration secret that contains your Cal.com API key. You would
169
- #
170
- # @param event_type_id [Integer] Event Type ID for which slots are being fetched. [cal.com](https://cal.com/docs/
171
- end
172
- end
173
-
174
- class Retrieval < Telnyx::Internal::Type::BaseModel
175
- # @!attribute retrieval
176
- #
177
- # @return [Telnyx::Models::AI::Assistant::Tool::Retrieval::Retrieval]
178
- required :retrieval, -> { Telnyx::AI::Assistant::Tool::Retrieval::Retrieval }
179
-
180
- # @!attribute type
181
- #
182
- # @return [Symbol, :retrieval]
183
- required :type, const: :retrieval
184
-
185
- # @!method initialize(retrieval:, type: :retrieval)
186
- # @param retrieval [Telnyx::Models::AI::Assistant::Tool::Retrieval::Retrieval]
187
- # @param type [Symbol, :retrieval]
188
-
189
- # @see Telnyx::Models::AI::Assistant::Tool::Retrieval#retrieval
190
- class Retrieval < Telnyx::Internal::Type::BaseModel
191
- # @!attribute bucket_ids
192
- #
193
- # @return [Array<String>]
194
- required :bucket_ids, Telnyx::Internal::Type::ArrayOf[String]
195
-
196
- # @!attribute max_num_results
197
- # The maximum number of results to retrieve as context for the language model.
198
- #
199
- # @return [Integer, nil]
200
- optional :max_num_results, Integer
201
-
202
- # @!method initialize(bucket_ids:, max_num_results: nil)
203
- # @param bucket_ids [Array<String>]
204
- #
205
- # @param max_num_results [Integer] The maximum number of results to retrieve as context for the language model.
206
- end
207
- end
64
+ variant :retrieval, -> { Telnyx::CallControlRetrievalTool }
208
65
 
209
66
  # @!method self.variants
210
- # @return [Array(Telnyx::Models::AI::Assistant::Tool::BookAppointment, Telnyx::Models::AI::Assistant::Tool::CheckAvailability, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::AI::Assistant::Tool::Retrieval)]
67
+ # @return [Array(Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool)]
211
68
  end
212
69
  end
213
70
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ class BookAppointmentTool < Telnyx::Internal::Type::BaseModel
6
+ # @!attribute book_appointment
7
+ #
8
+ # @return [Telnyx::Models::BookAppointmentToolParams]
9
+ required :book_appointment, -> { Telnyx::BookAppointmentToolParams }
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, Telnyx::Models::BookAppointmentTool::Type]
14
+ required :type, enum: -> { Telnyx::BookAppointmentTool::Type }
15
+
16
+ # @!method initialize(book_appointment:, type:)
17
+ # @param book_appointment [Telnyx::Models::BookAppointmentToolParams]
18
+ # @param type [Symbol, Telnyx::Models::BookAppointmentTool::Type]
19
+
20
+ # @see Telnyx::Models::BookAppointmentTool#type
21
+ module Type
22
+ extend Telnyx::Internal::Type::Enum
23
+
24
+ BOOK_APPOINTMENT = :book_appointment
25
+
26
+ # @!method self.values
27
+ # @return [Array<Symbol>]
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ class BookAppointmentToolParams < Telnyx::Internal::Type::BaseModel
6
+ # @!attribute api_key_ref
7
+ # Reference to an integration secret that contains your Cal.com API key. You would
8
+ # pass the `identifier` for an integration secret
9
+ # [/v2/integration_secrets](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
10
+ # that refers to your Cal.com API key.
11
+ #
12
+ # @return [String]
13
+ required :api_key_ref, String
14
+
15
+ # @!attribute event_type_id
16
+ # Event Type ID for which slots are being fetched.
17
+ # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-event-type-id)
18
+ #
19
+ # @return [Integer]
20
+ required :event_type_id, Integer
21
+
22
+ # @!attribute attendee_name
23
+ # The name of the attendee
24
+ # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee-name).
25
+ # If not provided, the assistant will ask for the attendee's name.
26
+ #
27
+ # @return [String, nil]
28
+ optional :attendee_name, String
29
+
30
+ # @!attribute attendee_timezone
31
+ # The timezone of the attendee
32
+ # [cal.com](https://cal.com/docs/api-reference/v2/bookings/create-a-booking#body-attendee-timezone).
33
+ # If not provided, the assistant will ask for the attendee's timezone.
34
+ #
35
+ # @return [String, nil]
36
+ optional :attendee_timezone, String
37
+
38
+ # @!method initialize(api_key_ref:, event_type_id:, attendee_name: nil, attendee_timezone: nil)
39
+ # Some parameter documentations has been truncated, see
40
+ # {Telnyx::Models::BookAppointmentToolParams} for more details.
41
+ #
42
+ # @param api_key_ref [String] Reference to an integration secret that contains your Cal.com API key. You would
43
+ #
44
+ # @param event_type_id [Integer] Event Type ID for which slots are being fetched. [cal.com](https://cal.com/docs/
45
+ #
46
+ # @param attendee_name [String] The name of the attendee [cal.com](https://cal.com/docs/api-reference/v2/booking
47
+ #
48
+ # @param attendee_timezone [String] The timezone of the attendee [cal.com](https://cal.com/docs/api-reference/v2/boo
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,176 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ class CallAssistantRequest < Telnyx::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The identifier of the AI assistant to use.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute dynamic_variables
13
+ # Map of dynamic variables and their default values. Dynamic variables can be
14
+ # referenced in instructions, greeting, and tool definitions using the
15
+ # `{{variable_name}}` syntax. Call-control-agent automatically merges in
16
+ # `telnyx_call_*` variables (telnyx_call_to, telnyx_call_from,
17
+ # telnyx_conversation_channel, telnyx_agent_target, telnyx_end_user_target,
18
+ # telnyx_call_caller_id_name) and custom header variables.
19
+ #
20
+ # @return [Hash{Symbol=>String, Float, Boolean}, nil]
21
+ optional :dynamic_variables,
22
+ -> { Telnyx::Internal::Type::HashOf[union: Telnyx::CallAssistantRequest::DynamicVariable] }
23
+
24
+ # @!attribute external_llm
25
+ # External LLM configuration for bringing your own LLM endpoint.
26
+ #
27
+ # @return [Hash{Symbol=>Object}, nil]
28
+ optional :external_llm, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
29
+
30
+ # @!attribute fallback_config
31
+ # Fallback LLM configuration used when the primary LLM provider is unavailable.
32
+ #
33
+ # @return [Hash{Symbol=>Object}, nil]
34
+ optional :fallback_config, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
35
+
36
+ # @!attribute greeting
37
+ # Initial greeting text spoken when the assistant starts. Can be plain text for
38
+ # any voice or SSML for `AWS.Polly.<voice_id>` voices. There is a 3,000 character
39
+ # limit.
40
+ #
41
+ # @return [String, nil]
42
+ optional :greeting, String
43
+
44
+ # @!attribute instructions
45
+ # System instructions for the voice assistant. Can be templated with
46
+ # [dynamic variables](https://developers.telnyx.com/docs/inference/ai-assistants/dynamic-variables).
47
+ # This will overwrite the instructions set in the assistant configuration.
48
+ #
49
+ # @return [String, nil]
50
+ optional :instructions, String
51
+
52
+ # @!attribute llm_api_key_ref
53
+ # Integration secret identifier for the LLM provider API key. Use this field to
54
+ # reference an
55
+ # [integration secret](https://developers.telnyx.com/api/secrets-manager/integration-secrets/create-integration-secret)
56
+ # containing your LLM provider API key. Supports any LLM provider (OpenAI,
57
+ # Anthropic, etc.).
58
+ #
59
+ # @return [String, nil]
60
+ optional :llm_api_key_ref, String
61
+
62
+ # @!attribute mcp_servers
63
+ # MCP (Model Context Protocol) server configurations for extending the assistant's
64
+ # capabilities with external tools and data sources.
65
+ #
66
+ # @return [Array<Hash{Symbol=>Object}>, nil]
67
+ optional :mcp_servers,
68
+ Telnyx::Internal::Type::ArrayOf[Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]]
69
+
70
+ # @!attribute model
71
+ # LLM model override for this call. If omitted, the assistant's configured model
72
+ # is used.
73
+ #
74
+ # @return [String, nil]
75
+ optional :model, String
76
+
77
+ # @!attribute name
78
+ # Assistant name override for this call.
79
+ #
80
+ # @return [String, nil]
81
+ optional :name, String
82
+
83
+ # @!attribute observability_settings
84
+ # Observability configuration for the assistant session, including Langfuse
85
+ # integration for tracing and monitoring.
86
+ #
87
+ # @return [Hash{Symbol=>Object}, nil]
88
+ optional :observability_settings, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
89
+
90
+ # @!attribute openai_api_key_ref
91
+ # @deprecated This field is deprecated and will be removed soon
92
+ #
93
+ # Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for
94
+ # the OpenAI API key. This field is maintained for backward compatibility;
95
+ # `llm_api_key_ref` is the canonical field name and supports all LLM providers.
96
+ #
97
+ # @return [String, nil]
98
+ optional :openai_api_key_ref, String
99
+
100
+ # @!attribute tools
101
+ # Inline tool definitions available to the assistant (webhook, retrieval,
102
+ # transfer, hangup, etc.). Overrides the assistant's stored tools if provided.
103
+ #
104
+ # @return [Array<Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool>, nil]
105
+ optional :tools, -> { Telnyx::Internal::Type::ArrayOf[union: Telnyx::CallAssistantRequest::Tool] }
106
+
107
+ # @!method initialize(id:, dynamic_variables: nil, external_llm: nil, fallback_config: nil, greeting: nil, instructions: nil, llm_api_key_ref: nil, mcp_servers: nil, model: nil, name: nil, observability_settings: nil, openai_api_key_ref: nil, tools: nil)
108
+ # Some parameter documentations has been truncated, see
109
+ # {Telnyx::Models::CallAssistantRequest} for more details.
110
+ #
111
+ # AI Assistant configuration. All fields except `id` are optional — the
112
+ # assistant's stored configuration will be used as fallback for any omitted
113
+ # fields.
114
+ #
115
+ # @param id [String] The identifier of the AI assistant to use.
116
+ #
117
+ # @param dynamic_variables [Hash{Symbol=>String, Float, Boolean}] Map of dynamic variables and their default values. Dynamic variables can be refe
118
+ #
119
+ # @param external_llm [Hash{Symbol=>Object}] External LLM configuration for bringing your own LLM endpoint.
120
+ #
121
+ # @param fallback_config [Hash{Symbol=>Object}] Fallback LLM configuration used when the primary LLM provider is unavailable.
122
+ #
123
+ # @param greeting [String] Initial greeting text spoken when the assistant starts. Can be plain text for an
124
+ #
125
+ # @param instructions [String] System instructions for the voice assistant. Can be templated with [dynamic vari
126
+ #
127
+ # @param llm_api_key_ref [String] Integration secret identifier for the LLM provider API key. Use this field to re
128
+ #
129
+ # @param mcp_servers [Array<Hash{Symbol=>Object}>] MCP (Model Context Protocol) server configurations for extending the assistant's
130
+ #
131
+ # @param model [String] LLM model override for this call. If omitted, the assistant's configured model i
132
+ #
133
+ # @param name [String] Assistant name override for this call.
134
+ #
135
+ # @param observability_settings [Hash{Symbol=>Object}] Observability configuration for the assistant session, including Langfuse integr
136
+ #
137
+ # @param openai_api_key_ref [String] Deprecated — use `llm_api_key_ref` instead. Integration secret identifier for th
138
+ #
139
+ # @param tools [Array<Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool>] Inline tool definitions available to the assistant (webhook, retrieval, transfer
140
+
141
+ module DynamicVariable
142
+ extend Telnyx::Internal::Type::Union
143
+
144
+ variant String
145
+
146
+ variant Float
147
+
148
+ variant Telnyx::Internal::Type::Boolean
149
+
150
+ # @!method self.variants
151
+ # @return [Array(String, Float, Boolean)]
152
+ end
153
+
154
+ module Tool
155
+ extend Telnyx::Internal::Type::Union
156
+
157
+ discriminator :type
158
+
159
+ variant :book_appointment, -> { Telnyx::BookAppointmentTool }
160
+
161
+ variant :check_availability, -> { Telnyx::CheckAvailabilityTool }
162
+
163
+ variant :webhook, -> { Telnyx::AI::WebhookTool }
164
+
165
+ variant :hangup, -> { Telnyx::AI::HangupTool }
166
+
167
+ variant :transfer, -> { Telnyx::AI::TransferTool }
168
+
169
+ variant :retrieval, -> { Telnyx::CallControlRetrievalTool }
170
+
171
+ # @!method self.variants
172
+ # @return [Array(Telnyx::Models::BookAppointmentTool, Telnyx::Models::CheckAvailabilityTool, Telnyx::Models::AI::WebhookTool, Telnyx::Models::AI::HangupTool, Telnyx::Models::AI::TransferTool, Telnyx::Models::CallControlRetrievalTool)]
173
+ end
174
+ end
175
+ end
176
+ end