telnyx 5.173.0 → 5.174.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 (118) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/client.rb +0 -4
  5. data/lib/telnyx/lib/access_token.rb +141 -0
  6. data/lib/telnyx/lib/telephony_credentials.rb +87 -0
  7. data/lib/telnyx/lib.rb +2 -0
  8. data/lib/telnyx/models/ai/memory/namespaces/namespace_settings.rb +26 -0
  9. data/lib/telnyx/models/ai/memory/namespaces/namespace_settings_response.rb +3 -41
  10. data/lib/telnyx/models/ai/memory/namespaces/summary_settings.rb +33 -0
  11. data/lib/telnyx/models/ai/transcription_challenger.rb +148 -0
  12. data/lib/telnyx/models/ai/transcription_fallback_model.rb +78 -0
  13. data/lib/telnyx/models/ai/transcription_settings.rb +6 -219
  14. data/lib/telnyx/models/compute/funcs/func_log_export_config.rb +96 -0
  15. data/lib/telnyx/models/compute/funcs/func_log_export_config_response.rb +3 -89
  16. data/lib/telnyx/models/email_template_common.rb +5 -26
  17. data/lib/telnyx/models/email_template_create_params.rb +5 -26
  18. data/lib/telnyx/models/messaging_outbound_message_payload.rb +22 -1
  19. data/lib/telnyx/models/messaging_profile_features.rb +16 -1
  20. data/lib/telnyx/models/model_metadata.rb +10 -1
  21. data/lib/telnyx/models/outbound_message_payload.rb +22 -1
  22. data/lib/telnyx/models/phone_numbers/numbers_phone_numbers_job.rb +6 -50
  23. data/lib/telnyx/models/phone_numbers/phone_numbers_job.rb +6 -50
  24. data/lib/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rb +28 -0
  25. data/lib/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rb +28 -0
  26. data/lib/telnyx/models/update_email_template_request.rb +5 -26
  27. data/lib/telnyx/models/variable_schema_entry.rb +28 -0
  28. data/lib/telnyx/models/whatsapp/hosted_signup_create_response.rb +3 -83
  29. data/lib/telnyx/models/whatsapp/hosted_signup_retrieve_response.rb +3 -84
  30. data/lib/telnyx/models/whatsapp/phone_number_get_response.rb +3 -191
  31. data/lib/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rb +3 -192
  32. data/lib/telnyx/models/whatsapp/{hosted_signup_list_response.rb → whatsapp_hosted_signup.rb} +8 -6
  33. data/lib/telnyx/models/whatsapp/{phone_number_list_response.rb → whatsapp_phone_response.rb} +12 -12
  34. data/lib/telnyx/models.rb +2 -0
  35. data/lib/telnyx/resources/email_templates.rb +3 -3
  36. data/lib/telnyx/resources/portouts.rb +2 -1
  37. data/lib/telnyx/resources/whatsapp/business_accounts/phone_numbers.rb +2 -2
  38. data/lib/telnyx/resources/whatsapp/hosted_signups.rb +2 -2
  39. data/lib/telnyx/resources/whatsapp/phone_numbers.rb +2 -2
  40. data/lib/telnyx/version.rb +1 -1
  41. data/lib/telnyx.rb +10 -5
  42. data/rbi/telnyx/client.rbi +0 -3
  43. data/rbi/telnyx/lib/access_token.rbi +73 -0
  44. data/rbi/telnyx/lib/telephony_credentials.rbi +50 -0
  45. data/rbi/telnyx/models/ai/memory/namespaces/namespace_settings.rbi +58 -0
  46. data/rbi/telnyx/models/ai/memory/namespaces/namespace_settings_response.rbi +4 -107
  47. data/rbi/telnyx/models/ai/memory/namespaces/summary_settings.rbi +51 -0
  48. data/rbi/telnyx/models/ai/transcription_challenger.rbi +318 -0
  49. data/rbi/telnyx/models/ai/transcription_fallback_model.rbi +171 -0
  50. data/rbi/telnyx/models/ai/transcription_settings.rbi +7 -531
  51. data/rbi/telnyx/models/compute/funcs/func_log_export_config.rbi +175 -0
  52. data/rbi/telnyx/models/compute/funcs/func_log_export_config_response.rbi +4 -176
  53. data/rbi/telnyx/models/email_template_common.rbi +3 -56
  54. data/rbi/telnyx/models/email_template_create_params.rbi +3 -59
  55. data/rbi/telnyx/models/messaging_outbound_message_payload.rbi +26 -0
  56. data/rbi/telnyx/models/messaging_profile_features.rbi +36 -5
  57. data/rbi/telnyx/models/model_metadata.rbi +13 -0
  58. data/rbi/telnyx/models/outbound_message_payload.rbi +26 -0
  59. data/rbi/telnyx/models/phone_numbers/numbers_phone_numbers_job.rbi +8 -96
  60. data/rbi/telnyx/models/phone_numbers/phone_numbers_job.rbi +8 -94
  61. data/rbi/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rbi +49 -0
  62. data/rbi/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rbi +49 -0
  63. data/rbi/telnyx/models/update_email_template_request.rbi +3 -59
  64. data/rbi/telnyx/models/variable_schema_entry.rbi +40 -0
  65. data/rbi/telnyx/models/whatsapp/hosted_signup_create_response.rbi +6 -173
  66. data/rbi/telnyx/models/whatsapp/hosted_signup_retrieve_response.rbi +6 -175
  67. data/rbi/telnyx/models/whatsapp/phone_number_get_response.rbi +4 -366
  68. data/rbi/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbi +6 -368
  69. data/rbi/telnyx/models/whatsapp/{hosted_signup_list_response.rbi → whatsapp_hosted_signup.rbi} +11 -12
  70. data/rbi/telnyx/models/whatsapp/{phone_number_list_response.rbi → whatsapp_phone_response.rbi} +23 -23
  71. data/rbi/telnyx/models.rbi +2 -0
  72. data/rbi/telnyx/resources/email_templates.rbi +3 -18
  73. data/rbi/telnyx/resources/portouts.rbi +2 -1
  74. data/rbi/telnyx/resources/whatsapp/business_accounts/phone_numbers.rbi +1 -1
  75. data/rbi/telnyx/resources/whatsapp/hosted_signups.rbi +1 -1
  76. data/rbi/telnyx/resources/whatsapp/phone_numbers.rbi +1 -1
  77. data/sig/telnyx/client.rbs +0 -2
  78. data/sig/telnyx/models/ai/memory/namespaces/namespace_settings.rbs +30 -0
  79. data/sig/telnyx/models/ai/memory/namespaces/namespace_settings_response.rbs +4 -37
  80. data/sig/telnyx/models/ai/memory/namespaces/summary_settings.rbs +19 -0
  81. data/sig/telnyx/models/ai/transcription_challenger.rbs +98 -0
  82. data/sig/telnyx/models/ai/transcription_fallback_model.rbs +63 -0
  83. data/sig/telnyx/models/ai/transcription_settings.rbs +8 -159
  84. data/sig/telnyx/models/compute/funcs/func_log_export_config.rbs +96 -0
  85. data/sig/telnyx/models/compute/funcs/func_log_export_config_response.rbs +6 -95
  86. data/sig/telnyx/models/email_template_common.rbs +4 -18
  87. data/sig/telnyx/models/email_template_create_params.rbs +4 -18
  88. data/sig/telnyx/models/messaging_outbound_message_payload.rbs +10 -0
  89. data/sig/telnyx/models/messaging_profile_features.rbs +14 -3
  90. data/sig/telnyx/models/model_metadata.rbs +7 -0
  91. data/sig/telnyx/models/outbound_message_payload.rbs +10 -0
  92. data/sig/telnyx/models/phone_numbers/numbers_phone_numbers_job.rbs +12 -44
  93. data/sig/telnyx/models/phone_numbers/phone_numbers_job.rbs +12 -44
  94. data/sig/telnyx/models/phone_numbers/phone_numbers_job_pending_operation.rbs +24 -0
  95. data/sig/telnyx/models/phone_numbers/phone_numbers_job_successful_operation.rbs +24 -0
  96. data/sig/telnyx/models/update_email_template_request.rbs +4 -18
  97. data/sig/telnyx/models/variable_schema_entry.rbs +17 -0
  98. data/sig/telnyx/models/whatsapp/hosted_signup_create_response.rbs +6 -90
  99. data/sig/telnyx/models/whatsapp/hosted_signup_retrieve_response.rbs +6 -90
  100. data/sig/telnyx/models/whatsapp/phone_number_get_response.rbs +6 -185
  101. data/sig/telnyx/models/whatsapp/phone_number_retrieve_phone_number_response.rbs +4 -189
  102. data/sig/telnyx/models/whatsapp/{hosted_signup_list_response.rbs → whatsapp_hosted_signup.rbs} +11 -9
  103. data/sig/telnyx/models/whatsapp/{phone_number_list_response.rbs → whatsapp_phone_response.rbs} +13 -11
  104. data/sig/telnyx/models.rbs +2 -0
  105. data/sig/telnyx/resources/email_templates.rbs +3 -3
  106. data/sig/telnyx/resources/whatsapp/business_accounts/phone_numbers.rbs +1 -1
  107. data/sig/telnyx/resources/whatsapp/hosted_signups.rbs +1 -1
  108. data/sig/telnyx/resources/whatsapp/phone_numbers.rbs +1 -1
  109. metadata +36 -17
  110. data/lib/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rb +0 -198
  111. data/lib/telnyx/resources/tts_integrations/actions.rb +0 -16
  112. data/lib/telnyx/resources/tts_integrations.rb +0 -18
  113. data/rbi/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbi +0 -358
  114. data/rbi/telnyx/resources/tts_integrations/actions.rbi +0 -14
  115. data/rbi/telnyx/resources/tts_integrations.rbi +0 -15
  116. data/sig/telnyx/models/whatsapp/business_accounts/phone_number_list_response.rbs +0 -186
  117. data/sig/telnyx/resources/tts_integrations/actions.rbs +0 -9
  118. data/sig/telnyx/resources/tts_integrations.rbs +0 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8a0d9edaab7084b74be27c5c41e73fc0089a2ef12cddd59fb974320a0144439
4
- data.tar.gz: 5657256ca67f97cade75834a3247666105fdb2e05853aed4a5e54d84f40fefe8
3
+ metadata.gz: 3fac885ac7ccf74c3f9f991d7dca38d2155d645e1a24cbfb8fa849ff010f78b7
4
+ data.tar.gz: 75d6ae4f9f701214078d8c9e7a43258b677bb82a29074a26634beaa2c4628738
5
5
  SHA512:
6
- metadata.gz: 9fae567fb853b28065d5791761ce257b840a971e8628c5b31930b74c7f45b21ee1e707903bf26921eff9f2538249dd55cca5f3c39b8550b038ffd9d33e011d51
7
- data.tar.gz: 0073a20d3cf951262e622b5caf07990c4ee8e80085e0c18a6f9e3e6639d5d26cec68f7cb54883a0c48e8c9a2fea22e9a89f8ec9ad98e475cc3c299db27b47784
6
+ metadata.gz: 137fadbbd6825fe3335c3dc2aad76145d5c9af2c693023ca98905d63ca5ffd87f71d2b3ea56ae6ba0a744cb5d5c09fd2bf6219aad7ae960ed9bd9e3712feaaf0
7
+ data.tar.gz: 5b42c035897d4698f6ae5c7e6c20ce6305d8dbd7227927305e5825cc5215c587d73b7c5825432c423ff0517943b71d1b804aa88e5d5bda93ed86fc560ae0f5c5
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [5.174.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.173.0...v5.174.0) (2026-10-29)
4
+
5
+
6
+ ### Features
7
+
8
+ * promote from staging 458522c ([15f8625](https://github.com/team-telnyx/telnyx-ruby/commit/15f86251ff7ccfc9ec222355907441ddc10b1b07))
9
+
3
10
  ## [5.173.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.172.0...v5.173.0) (2026-10-28)
4
11
 
5
12
 
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.173.0"
27
+ gem "telnyx", "~> 5.174.0"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
data/lib/telnyx/client.rb CHANGED
@@ -824,9 +824,6 @@ module Telnyx
824
824
  # @return [Telnyx::Resources::DialMetrics]
825
825
  attr_reader :dial_metrics
826
826
 
827
- # @return [Telnyx::Resources::TtsIntegrations]
828
- attr_reader :tts_integrations
829
-
830
827
  # Tailscale Subnet Router operations
831
828
  # @return [Telnyx::Resources::TailscaleSubnetRouters]
832
829
  attr_reader :tailscale_subnet_routers
@@ -1153,7 +1150,6 @@ module Telnyx
1153
1150
  @llm_token_gateway = Telnyx::Resources::LlmTokenGateway.new(client: self)
1154
1151
  @sip_registration_status = Telnyx::Resources::SipRegistrationStatus.new(client: self)
1155
1152
  @dial_metrics = Telnyx::Resources::DialMetrics.new(client: self)
1156
- @tts_integrations = Telnyx::Resources::TtsIntegrations.new(client: self)
1157
1153
  @tailscale_subnet_routers = Telnyx::Resources::TailscaleSubnetRouters.new(client: self)
1158
1154
  @artifact_downloads = Telnyx::Resources::ArtifactDownloads.new(client: self)
1159
1155
  @email = Telnyx::Resources::Email.new(client: self)
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "base64"
4
+ require "json"
5
+ require "openssl"
6
+
7
+ module Telnyx
8
+ module Lib
9
+ # Mints a WebRTC login token for a telephony credential locally, with no
10
+ # request to Telnyx.
11
+ #
12
+ # The token has the same shape as the one `POST /v2/telephony_credentials/:id/token`
13
+ # (`client.telephony_credentials.create_token`) returns, so it is used the
14
+ # same way: pass it to the WebRTC SDK as `login_token`. Telnyx verifies it
15
+ # on login.
16
+ #
17
+ # The signing material comes from the credential: `token_material` is in the
18
+ # response of `POST /v2/telephony_credentials` and of
19
+ # `GET /v2/telephony_credentials/:id/token_material`. It is as sensitive as
20
+ # the SIP password, so keep it on the server; never ship it to a browser.
21
+ #
22
+ # credential = client.telephony_credentials.create(connection_id: "123")
23
+ # client.telephony_credentials.to_jwt(credential) # 1 hour
24
+ # client.telephony_credentials.to_jwt(credential, ttl: 600) # 10 minutes
25
+ #
26
+ # Or from stored values, with no client at all:
27
+ #
28
+ # Telnyx::Lib::AccessToken.new(
29
+ # credential_id: "...", user_id: "...", identity: "gencred...",
30
+ # expires_at: "2027-01-01T00:00:00Z",
31
+ # token_material: {kid: "v1", tel_token: "...", signing_secret: "..."}
32
+ # ).to_jwt
33
+ class AccessToken
34
+ DEFAULT_TTL = 3600
35
+ MAX_TTL = 86_400
36
+ CONTENT_TYPE = "telnyx-webrtc;v=1"
37
+ ALGORITHM = "HS256"
38
+ MATERIAL_FIELDS = [:kid, :tel_token, :signing_secret].freeze
39
+
40
+ # Raised by {AccessToken.decode} when the signature does not match.
41
+ class SignatureError < StandardError
42
+ end
43
+
44
+ attr_reader :credential_id, :user_id, :identity, :expires_at, :ttl
45
+
46
+ # @param credential_id [String] the telephony credential `id`
47
+ # @param user_id [String] the credential's `user_id`
48
+ # @param identity [String] the credential's `sip_username`
49
+ # @param token_material [Hash, Telnyx::Internal::Type::BaseModel] `kid`, `tel_token`, `signing_secret`
50
+ # @param expires_at [String, nil] the credential's `expires_at`, as the API returns it
51
+ # @param ttl [Integer] token lifetime in seconds, 1..86400; default one hour
52
+ def initialize(credential_id:, user_id:, identity:, token_material:, expires_at: nil, ttl: DEFAULT_TTL)
53
+ @credential_id = required(credential_id, "credential_id")
54
+ @user_id = required(user_id, "user_id")
55
+ @identity = required(identity, "identity")
56
+ @expires_at = expires_at
57
+ @material = normalize_material(token_material)
58
+ @ttl = Integer(ttl).clamp(1, MAX_TTL)
59
+ end
60
+
61
+ # The signed token, valid from `now` for `ttl` seconds.
62
+ #
63
+ # @param now [Time]
64
+ #
65
+ # @return [String]
66
+ def to_jwt(now: Time.now)
67
+ iat = now.to_i
68
+ header = {alg: ALGORITHM, typ: "JWT", cty: CONTENT_TYPE, kid: @material.fetch(:kid)}
69
+ payload = {
70
+ sub: credential_id,
71
+ user_id: user_id,
72
+ identity: identity,
73
+ cred_exp: expires_at,
74
+ tel_token: @material.fetch(:tel_token),
75
+ iat: iat,
76
+ nbf: iat,
77
+ exp: iat + ttl,
78
+ jti: "#{credential_id}-#{iat}"
79
+ }
80
+
81
+ signing_input = "#{encode(JSON.generate(header))}.#{encode(JSON.generate(payload))}"
82
+ "#{signing_input}.#{encode(self.class.sign(signing_input, @material.fetch(:signing_secret)))}"
83
+ end
84
+
85
+ alias_method :to_s, :to_jwt
86
+
87
+ class << self
88
+ # Decodes a token minted by this class and checks its signature against
89
+ # `signing_secret`. Meant for tests and debugging: Telnyx does the real
90
+ # verification on login.
91
+ #
92
+ # @param jwt [String]
93
+ # @param signing_secret [String] base64url, as in `token_material`
94
+ #
95
+ # @raise [Telnyx::Lib::AccessToken::SignatureError] if the signature does not match
96
+ # @return [Hash{String=>Object}] the claims
97
+ def decode(jwt, signing_secret:)
98
+ head, body, sig = jwt.to_s.split(".")
99
+ raise ArgumentError.new("not a JWT") if sig.nil?
100
+
101
+ expected = sign("#{head}.#{body}", signing_secret)
102
+ given = Base64.urlsafe_decode64(sig)
103
+ valid = given.bytesize == expected.bytesize && OpenSSL.fixed_length_secure_compare(given, expected)
104
+ raise SignatureError.new("signature does not match the payload") unless valid
105
+
106
+ JSON.parse(Base64.urlsafe_decode64(body))
107
+ end
108
+
109
+ # @param signing_input [String]
110
+ # @param signing_secret [String] base64url
111
+ #
112
+ # @return [String] raw HMAC-SHA256 bytes
113
+ def sign(signing_input, signing_secret)
114
+ OpenSSL::HMAC.digest("SHA256", Base64.urlsafe_decode64(signing_secret), signing_input)
115
+ end
116
+ end
117
+
118
+ private
119
+
120
+ def encode(bytes) = Base64.urlsafe_encode64(bytes, padding: false)
121
+
122
+ def required(value, name)
123
+ raise ArgumentError.new("#{name} is required to mint a token") if value.nil? || value.to_s.empty?
124
+
125
+ value.to_s
126
+ end
127
+
128
+ def normalize_material(material)
129
+ hash = material.respond_to?(:to_hash) ? material.to_hash : material
130
+ raise ArgumentError.new("token_material is required to mint a token") unless hash.is_a?(Hash)
131
+
132
+ MATERIAL_FIELDS.to_h do |field|
133
+ value = hash[field] || hash[field.to_s]
134
+ raise ArgumentError.new("token_material.#{field} is missing") if value.nil? || value.to_s.empty?
135
+
136
+ [field, value.to_s]
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,87 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "access_token"
4
+
5
+ module Telnyx
6
+ module Lib
7
+ # Local WebRTC login tokens for `client.telephony_credentials`. Mixed into
8
+ # the generated {Telnyx::Resources::TelephonyCredentials} from `lib/telnyx/lib.rb`,
9
+ # so it survives codegen.
10
+ module TelephonyCredentials
11
+ # A WebRTC login token for a credential, minted locally with no request
12
+ # to Telnyx per token. Same use as `create_token`: hand it to the WebRTC
13
+ # SDK as `login_token`.
14
+ #
15
+ # The signing material (`kid`, `tel_token`, `signing_secret`) is read from
16
+ # the credential's `token_material`, present on the `create` response. A
17
+ # credential given by id, or one from `retrieve` or `list`, fetches it
18
+ # with {#fetch_token_material}. Pass `token_material:` to mint from values
19
+ # stored earlier, with no request at all.
20
+ #
21
+ # @param credential [String, Telnyx::Models::TelephonyCredential, Telnyx::Models::TelephonyCredentialCreateResponse, Telnyx::Models::TelephonyCredentialRetrieveResponse]
22
+ # the credential id, the credential, or the `create` / `retrieve` response holding it
23
+ #
24
+ # @param ttl [Integer] token lifetime in seconds, 1..86400; default one hour
25
+ #
26
+ # @param token_material [Hash{Symbol=>String}, nil] `kid`, `tel_token`, `signing_secret` stored earlier
27
+ #
28
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
29
+ #
30
+ # @return [String]
31
+ def to_jwt(
32
+ credential,
33
+ ttl: Telnyx::Lib::AccessToken::DEFAULT_TTL,
34
+ token_material: nil,
35
+ request_options: {}
36
+ )
37
+ model = credential_model(credential, request_options: request_options)
38
+ material = token_material || model[:token_material] ||
39
+ fetch_token_material(model.id, request_options: request_options)
40
+
41
+ Telnyx::Lib::AccessToken.new(
42
+ credential_id: model.id,
43
+ user_id: model.user_id,
44
+ identity: model.sip_username,
45
+ expires_at: model.expires_at,
46
+ token_material: material,
47
+ ttl: ttl
48
+ ).to_jwt
49
+ end
50
+
51
+ # `GET /v2/telephony_credentials/:id/token_material`. Treat the result
52
+ # like the SIP password: keep it on the server.
53
+ #
54
+ # @param id [String] Identifies the resource.
55
+ #
56
+ # @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}, nil]
57
+ #
58
+ # @return [Hash{Symbol=>Object}] `kid`, `tel_token`, `signing_secret`
59
+ def fetch_token_material(id, request_options: {})
60
+ body = @client.request(
61
+ method: :get,
62
+ path: ["telephony_credentials/%1$s/token_material", id],
63
+ model: Telnyx::Internal::Type::Unknown,
64
+ options: request_options
65
+ )
66
+ body.is_a?(Hash) && body.key?(:data) ? body.fetch(:data) : body
67
+ end
68
+
69
+ private
70
+
71
+ # @return [Telnyx::Models::TelephonyCredential]
72
+ def credential_model(credential, request_options:)
73
+ model = credential.respond_to?(:data) ? credential.data : credential
74
+ model = retrieve(model, request_options: request_options).data if model.is_a?(String)
75
+ return model if model.is_a?(Telnyx::Models::TelephonyCredential)
76
+
77
+ raise ArgumentError.new("expected a telephony credential or its id, got #{credential.inspect}")
78
+ end
79
+ end
80
+ end
81
+
82
+ module Resources
83
+ class TelephonyCredentials
84
+ include Telnyx::Lib::TelephonyCredentials
85
+ end
86
+ end
87
+ end
data/lib/telnyx/lib.rb CHANGED
@@ -14,3 +14,5 @@
14
14
  require_relative "lib/webhook_verification_error"
15
15
  require_relative "lib/webhook_verification"
16
16
  require_relative "lib/websocket"
17
+ require_relative "lib/access_token"
18
+ require_relative "lib/telephony_credentials"
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module Memory
7
+ module Namespaces
8
+ class NamespaceSettings < Telnyx::Internal::Type::BaseModel
9
+ # @!attribute summary
10
+ # Settings that shape this namespace's summaries.
11
+ #
12
+ # @return [Telnyx::Models::AI::Memory::Namespaces::SummarySettings, nil]
13
+ optional :summary, -> { Telnyx::AI::Memory::Namespaces::SummarySettings }
14
+
15
+ # @!method initialize(summary: nil)
16
+ # A namespace's settings, grouped by what they affect.
17
+ #
18
+ # @param summary [Telnyx::Models::AI::Memory::Namespaces::SummarySettings] Settings that shape this namespace's summaries.
19
+ end
20
+ end
21
+
22
+ NamespaceSettings = Namespaces::NamespaceSettings
23
+ end
24
+ end
25
+ end
26
+ end
@@ -10,49 +10,11 @@ module Telnyx
10
10
  # @!attribute data
11
11
  # A namespace's settings, grouped by what they affect.
12
12
  #
13
- # @return [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data]
14
- required :data, -> { Telnyx::AI::Memory::Namespaces::NamespaceSettingsResponse::Data }
13
+ # @return [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettings]
14
+ required :data, -> { Telnyx::AI::Memory::Namespaces::NamespaceSettings }
15
15
 
16
16
  # @!method initialize(data:)
17
- # @param data [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data] A namespace's settings, grouped by what they affect.
18
-
19
- # @see Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse#data
20
- class Data < Telnyx::Internal::Type::BaseModel
21
- # @!attribute summary
22
- # Settings that shape this namespace's summaries.
23
- #
24
- # @return [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data::Summary, nil]
25
- optional :summary, -> { Telnyx::AI::Memory::Namespaces::NamespaceSettingsResponse::Data::Summary }
26
-
27
- # @!method initialize(summary: nil)
28
- # A namespace's settings, grouped by what they affect.
29
- #
30
- # @param summary [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data::Summary] Settings that shape this namespace's summaries.
31
-
32
- # @see Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data#summary
33
- class Summary < Telnyx::Internal::Type::BaseModel
34
- # @!attribute instructions
35
- # Free-form instructions that influence how this namespace's summaries are
36
- # written, shared by every profile in the namespace. How you use them is up to you
37
- # -- they steer the outcome, so try a phrasing and see how the summary comes out.
38
- # Advisory: they steer the summary but never override or deny a profile's own
39
- # facts, and they do not affect recall. Null or empty means none are set, and
40
- # summaries use the neutral default. A change reaches each summary the next time
41
- # it is regenerated.
42
- #
43
- # @return [String, nil]
44
- optional :instructions, String, nil?: true
45
-
46
- # @!method initialize(instructions: nil)
47
- # Some parameter documentations has been truncated, see
48
- # {Telnyx::Models::AI::Memory::Namespaces::NamespaceSettingsResponse::Data::Summary}
49
- # for more details.
50
- #
51
- # Settings that shape this namespace's summaries.
52
- #
53
- # @param instructions [String, nil] Free-form instructions that influence how this namespace's summaries are written
54
- end
55
- end
17
+ # @param data [Telnyx::Models::AI::Memory::Namespaces::NamespaceSettings] A namespace's settings, grouped by what they affect.
56
18
  end
57
19
  end
58
20
 
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ module Memory
7
+ module Namespaces
8
+ class SummarySettings < Telnyx::Internal::Type::BaseModel
9
+ # @!attribute instructions
10
+ # Free-form instructions that influence how this namespace's summaries are
11
+ # written, shared by every profile in the namespace. How you use them is up to you
12
+ # -- they steer the outcome, so try a phrasing and see how the summary comes out.
13
+ # Advisory: they steer the summary but never override or deny a profile's own
14
+ # facts, and they do not affect recall. Null or empty means none are set, and
15
+ # summaries use the neutral default. A change reaches each summary the next time
16
+ # it is regenerated.
17
+ #
18
+ # @return [String, nil]
19
+ optional :instructions, String, nil?: true
20
+
21
+ # @!method initialize(instructions: nil)
22
+ # Some parameter documentations has been truncated, see
23
+ # {Telnyx::Models::AI::Memory::Namespaces::SummarySettings} for more details.
24
+ #
25
+ # A namespace's summary settings, shared by every profile in it.
26
+ #
27
+ # @param instructions [String, nil] Free-form instructions that influence how this namespace's summaries are written
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,148 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ class TranscriptionChallenger < Telnyx::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # The language booster's model. It must be the same kind of model as
9
+ # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
10
+ # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
11
+ # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
12
+ # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
13
+ # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
14
+ # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
15
+ # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
16
+ # `transcription.model` on a different `language`.
17
+ #
18
+ # @return [Symbol, Telnyx::Models::AI::TranscriptionChallenger::Model]
19
+ required :model, enum: -> { Telnyx::AI::TranscriptionChallenger::Model }
20
+
21
+ # @!attribute language
22
+ # The language this model transcribes. Omit it or set it to `null` to use the
23
+ # language of `transcription.model`. The request is rejected when this model
24
+ # doesn't support the language it would run. It is also rejected when it would run
25
+ # the same model on the same language as `transcription.model`.
26
+ #
27
+ # @return [String, nil]
28
+ optional :language, String, nil?: true
29
+
30
+ # @!attribute rule
31
+ # How the assistant picks the transcript it uses. The models are compared on how
32
+ # complete and confident their transcripts are, not on language, so the rules work
33
+ # best when both models understand the callers' language.
34
+ #
35
+ # - `best_turn` (default): both models transcribe the whole call. Each turn uses
36
+ # the language booster's transcript only when it scores higher than the
37
+ # transcript of `transcription.model` (clearly higher with non-streaming
38
+ # models). With streaming models, `transcription.model` also decides when each
39
+ # turn ends. Available for every pair.
40
+ # - `best_engine`: both models transcribe the first turns, then the call continues
41
+ # alone on the model whose transcripts scored higher. If neither clearly leads,
42
+ # `transcription.model` continues. Streaming models only.
43
+ # - `merge_words`: both models transcribe each utterance and their words are
44
+ # merged, keeping Arabic and English spoken in the same sentence. Available only
45
+ # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
46
+ # the language that applies to `telnyx/basira` (its own, or that of
47
+ # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
48
+ # `multi`, or `auto`.
49
+ #
50
+ # @return [Symbol, Telnyx::Models::AI::TranscriptionChallenger::Rule, nil]
51
+ optional :rule, enum: -> { Telnyx::AI::TranscriptionChallenger::Rule }
52
+
53
+ # @!attribute settings
54
+ # Settings for the language booster, with the same fields and limits as
55
+ # `transcription.settings`. Fields that don't apply to this model's provider are
56
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
57
+ # `null` to use the settings of `transcription.model` where they apply to this
58
+ # model.
59
+ #
60
+ # @return [Telnyx::Models::AI::TranscriptionSettingsConfig, nil]
61
+ optional :settings, -> { Telnyx::AI::TranscriptionSettingsConfig }, nil?: true
62
+
63
+ # @!method initialize(model:, language: nil, rule: nil, settings: nil)
64
+ # Some parameter documentations has been truncated, see
65
+ # {Telnyx::Models::AI::TranscriptionChallenger} for more details.
66
+ #
67
+ # A second speech-to-text model that transcribes alongside `transcription.model`,
68
+ # and the rule that decides which transcript the assistant uses.
69
+ #
70
+ # @param model [Symbol, Telnyx::Models::AI::TranscriptionChallenger::Model] The language booster's model. It must be the same kind of model as `transcriptio
71
+ #
72
+ # @param language [String, nil] The language this model transcribes. Omit it or set it to `null` to use the lang
73
+ #
74
+ # @param rule [Symbol, Telnyx::Models::AI::TranscriptionChallenger::Rule] How the assistant picks the transcript it uses. The models are compared on how c
75
+ #
76
+ # @param settings [Telnyx::Models::AI::TranscriptionSettingsConfig, nil] Settings for the language booster, with the same fields and limits as `transcrip
77
+
78
+ # The language booster's model. It must be the same kind of model as
79
+ # `transcription.model`: both streaming (`deepgram/flux`, `deepgram/nova-3`,
80
+ # `deepgram/nova-2`, `assemblyai/universal-3-6-pro` or its legacy aliases
81
+ # `assemblyai/universal-3-5-pro` and `assemblyai/universal-streaming`,
82
+ # `xai/grok-stt`, `soniox/stt-rt-v4`, `soniox/stt-rt-v5`, `humain/realtime`,
83
+ # `reson8/turns`) or both non-streaming (`azure/fast`, `nvidia/parakeet-v3`,
84
+ # `omi-health/omi-med-stt-v1`, `cohere/ar-stt`, `distil-whisper/distil-large-v2`,
85
+ # `openai/whisper-large-v3-turbo`, `telnyx/basira`). It can be the same model as
86
+ # `transcription.model` on a different `language`.
87
+ #
88
+ # @see Telnyx::Models::AI::TranscriptionChallenger#model
89
+ module Model
90
+ extend Telnyx::Internal::Type::Enum
91
+
92
+ DEEPGRAM_FLUX = :"deepgram/flux"
93
+ DEEPGRAM_NOVA_3 = :"deepgram/nova-3"
94
+ DEEPGRAM_NOVA_2 = :"deepgram/nova-2"
95
+ AZURE_FAST = :"azure/fast"
96
+ ASSEMBLYAI_UNIVERSAL_3_6_PRO = :"assemblyai/universal-3-6-pro"
97
+ ASSEMBLYAI_UNIVERSAL_3_5_PRO = :"assemblyai/universal-3-5-pro"
98
+ ASSEMBLYAI_UNIVERSAL_STREAMING = :"assemblyai/universal-streaming"
99
+ XAI_GROK_STT = :"xai/grok-stt"
100
+ SONIOX_STT_RT_V4 = :"soniox/stt-rt-v4"
101
+ SONIOX_STT_RT_V5 = :"soniox/stt-rt-v5"
102
+ NVIDIA_PARAKEET_V3 = :"nvidia/parakeet-v3"
103
+ OMI_HEALTH_OMI_MED_STT_V1 = :"omi-health/omi-med-stt-v1"
104
+ HUMAIN_REALTIME = :"humain/realtime"
105
+ RESON8_TURNS = :"reson8/turns"
106
+ COHERE_AR_STT = :"cohere/ar-stt"
107
+ TELNYX_BASIRA = :"telnyx/basira"
108
+ DISTIL_WHISPER_DISTIL_LARGE_V2 = :"distil-whisper/distil-large-v2"
109
+ OPENAI_WHISPER_LARGE_V3_TURBO = :"openai/whisper-large-v3-turbo"
110
+
111
+ # @!method self.values
112
+ # @return [Array<Symbol>]
113
+ end
114
+
115
+ # How the assistant picks the transcript it uses. The models are compared on how
116
+ # complete and confident their transcripts are, not on language, so the rules work
117
+ # best when both models understand the callers' language.
118
+ #
119
+ # - `best_turn` (default): both models transcribe the whole call. Each turn uses
120
+ # the language booster's transcript only when it scores higher than the
121
+ # transcript of `transcription.model` (clearly higher with non-streaming
122
+ # models). With streaming models, `transcription.model` also decides when each
123
+ # turn ends. Available for every pair.
124
+ # - `best_engine`: both models transcribe the first turns, then the call continues
125
+ # alone on the model whose transcripts scored higher. If neither clearly leads,
126
+ # `transcription.model` continues. Streaming models only.
127
+ # - `merge_words`: both models transcribe each utterance and their words are
128
+ # merged, keeping Arabic and English spoken in the same sentence. Available only
129
+ # for `telnyx/basira` with `cohere/ar-stt`, in either order. The pair runs on
130
+ # the language that applies to `telnyx/basira` (its own, or that of
131
+ # `transcription.model`), which must be Arabic (`ar` or an `ar-` locale),
132
+ # `multi`, or `auto`.
133
+ #
134
+ # @see Telnyx::Models::AI::TranscriptionChallenger#rule
135
+ module Rule
136
+ extend Telnyx::Internal::Type::Enum
137
+
138
+ BEST_TURN = :best_turn
139
+ BEST_ENGINE = :best_engine
140
+ MERGE_WORDS = :merge_words
141
+
142
+ # @!method self.values
143
+ # @return [Array<Symbol>]
144
+ end
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,78 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telnyx
4
+ module Models
5
+ module AI
6
+ class TranscriptionFallbackModel < Telnyx::Internal::Type::BaseModel
7
+ # @!attribute model
8
+ # The fallback model. It must be a streaming model other than
9
+ # `transcription.model` and the other fallbacks: `deepgram/flux`,
10
+ # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
11
+ # legacy aliases `assemblyai/universal-3-5-pro` and
12
+ # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
13
+ # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
14
+ #
15
+ # @return [Symbol, Telnyx::Models::AI::TranscriptionFallbackModel::Model]
16
+ required :model, enum: -> { Telnyx::AI::TranscriptionFallbackModel::Model }
17
+
18
+ # @!attribute language
19
+ # The language the fallback transcribes. Omit it or set it to `null` to use the
20
+ # language of `transcription.model`. The request is rejected when the fallback
21
+ # model doesn't support the language it would run.
22
+ #
23
+ # @return [String, nil]
24
+ optional :language, String, nil?: true
25
+
26
+ # @!attribute settings
27
+ # Settings for the fallback, with the same fields and limits as
28
+ # `transcription.settings`. Fields that don't apply to this model's provider are
29
+ # dropped, and the provider's defaults fill in the rest. Omit it or set it to
30
+ # `null` to use the settings of `transcription.model` where they apply to this
31
+ # model.
32
+ #
33
+ # @return [Telnyx::Models::AI::TranscriptionSettingsConfig, nil]
34
+ optional :settings, -> { Telnyx::AI::TranscriptionSettingsConfig }, nil?: true
35
+
36
+ # @!method initialize(model:, language: nil, settings: nil)
37
+ # Some parameter documentations has been truncated, see
38
+ # {Telnyx::Models::AI::TranscriptionFallbackModel} for more details.
39
+ #
40
+ # A streaming speech-to-text model that takes over transcription when the model in
41
+ # use fails.
42
+ #
43
+ # @param model [Symbol, Telnyx::Models::AI::TranscriptionFallbackModel::Model] The fallback model. It must be a streaming model other than `transcription.model
44
+ #
45
+ # @param language [String, nil] The language the fallback transcribes. Omit it or set it to `null` to use the la
46
+ #
47
+ # @param settings [Telnyx::Models::AI::TranscriptionSettingsConfig, nil] Settings for the fallback, with the same fields and limits as `transcription.set
48
+
49
+ # The fallback model. It must be a streaming model other than
50
+ # `transcription.model` and the other fallbacks: `deepgram/flux`,
51
+ # `deepgram/nova-3`, `deepgram/nova-2`, `assemblyai/universal-3-6-pro` (or its
52
+ # legacy aliases `assemblyai/universal-3-5-pro` and
53
+ # `assemblyai/universal-streaming`), `xai/grok-stt`, `soniox/stt-rt-v4`,
54
+ # `soniox/stt-rt-v5`, `humain/realtime`, or `reson8/turns`.
55
+ #
56
+ # @see Telnyx::Models::AI::TranscriptionFallbackModel#model
57
+ module Model
58
+ extend Telnyx::Internal::Type::Enum
59
+
60
+ DEEPGRAM_FLUX = :"deepgram/flux"
61
+ DEEPGRAM_NOVA_3 = :"deepgram/nova-3"
62
+ DEEPGRAM_NOVA_2 = :"deepgram/nova-2"
63
+ ASSEMBLYAI_UNIVERSAL_3_6_PRO = :"assemblyai/universal-3-6-pro"
64
+ ASSEMBLYAI_UNIVERSAL_3_5_PRO = :"assemblyai/universal-3-5-pro"
65
+ ASSEMBLYAI_UNIVERSAL_STREAMING = :"assemblyai/universal-streaming"
66
+ XAI_GROK_STT = :"xai/grok-stt"
67
+ SONIOX_STT_RT_V4 = :"soniox/stt-rt-v4"
68
+ SONIOX_STT_RT_V5 = :"soniox/stt-rt-v5"
69
+ HUMAIN_REALTIME = :"humain/realtime"
70
+ RESON8_TURNS = :"reson8/turns"
71
+
72
+ # @!method self.values
73
+ # @return [Array<Symbol>]
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end