telnyx 5.166.0 → 5.167.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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +1 -1
  4. data/lib/telnyx/internal/default_flat_pagination.rb +7 -3
  5. data/lib/telnyx/internal/default_flat_pagination_for_inexplicit_number_orders.rb +7 -3
  6. data/lib/telnyx/internal/default_flat_pagination_top_level_array.rb +10 -8
  7. data/lib/telnyx/internal/default_pagination_for_log_messages.rb +7 -3
  8. data/lib/telnyx/internal/default_pagination_for_messaging_tollfree.rb +12 -3
  9. data/lib/telnyx/internal/default_pagination_for_queues.rb +12 -3
  10. data/lib/telnyx/internal/per_page_pagination.rb +8 -1
  11. data/lib/telnyx/internal/per_page_pagination_v2.rb +8 -1
  12. data/lib/telnyx/internal/type/converter.rb +2 -0
  13. data/lib/telnyx/models/ai/anthropic/v1_messages_params.rb +57 -1
  14. data/lib/telnyx/models/ai/chat_completion_request.rb +61 -1
  15. data/lib/telnyx/models/ai/openai_create_response_params.rb +57 -1
  16. data/lib/telnyx/models/messaging_messaging_profile.rb +274 -0
  17. data/lib/telnyx/models/messaging_profile.rb +0 -1
  18. data/lib/telnyx/models/messaging_profile_create_response.rb +3 -3
  19. data/lib/telnyx/models/messaging_profile_delete_response.rb +3 -3
  20. data/lib/telnyx/models/messaging_profile_retrieve_response.rb +3 -3
  21. data/lib/telnyx/models/messaging_profile_update_params.rb +22 -1
  22. data/lib/telnyx/models/messaging_profile_update_response.rb +3 -3
  23. data/lib/telnyx/models/messaging_profiles/action_regenerate_secret_response.rb +3 -3
  24. data/lib/telnyx/models.rb +2 -0
  25. data/lib/telnyx/resources/ai/anthropic/v1.rb +5 -1
  26. data/lib/telnyx/resources/ai/openai/chat.rb +5 -1
  27. data/lib/telnyx/resources/ai/openai.rb +5 -1
  28. data/lib/telnyx/resources/messaging_profiles.rb +7 -3
  29. data/lib/telnyx/version.rb +1 -1
  30. data/lib/telnyx.rb +1 -0
  31. data/rbi/telnyx/models/ai/anthropic/v1_messages_params.rbi +139 -0
  32. data/rbi/telnyx/models/ai/chat_completion_request.rbi +116 -0
  33. data/rbi/telnyx/models/ai/openai_create_response_params.rbi +136 -0
  34. data/rbi/telnyx/models/messaging_messaging_profile.rbi +444 -0
  35. data/rbi/telnyx/models/messaging_profile.rbi +4 -6
  36. data/rbi/telnyx/models/messaging_profile_create_response.rbi +6 -4
  37. data/rbi/telnyx/models/messaging_profile_delete_response.rbi +6 -4
  38. data/rbi/telnyx/models/messaging_profile_retrieve_response.rbi +6 -4
  39. data/rbi/telnyx/models/messaging_profile_update_params.rbi +32 -0
  40. data/rbi/telnyx/models/messaging_profile_update_response.rbi +6 -4
  41. data/rbi/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbi +4 -4
  42. data/rbi/telnyx/models.rbi +2 -0
  43. data/rbi/telnyx/resources/ai/anthropic/v1.rbi +14 -0
  44. data/rbi/telnyx/resources/ai/openai/chat.rbi +14 -0
  45. data/rbi/telnyx/resources/ai/openai.rbi +14 -0
  46. data/rbi/telnyx/resources/messaging_profiles.rbi +14 -1
  47. data/sig/telnyx/models/ai/anthropic/v1_messages_params.rbs +42 -0
  48. data/sig/telnyx/models/ai/chat_completion_request.rbs +42 -0
  49. data/sig/telnyx/models/ai/openai_create_response_params.rbs +42 -0
  50. data/sig/telnyx/models/messaging_messaging_profile.rbs +207 -0
  51. data/sig/telnyx/models/messaging_profile_create_response.rbs +8 -5
  52. data/sig/telnyx/models/messaging_profile_delete_response.rbs +8 -5
  53. data/sig/telnyx/models/messaging_profile_retrieve_response.rbs +7 -5
  54. data/sig/telnyx/models/messaging_profile_update_params.rbs +14 -0
  55. data/sig/telnyx/models/messaging_profile_update_response.rbs +8 -5
  56. data/sig/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbs +7 -5
  57. data/sig/telnyx/models.rbs +2 -0
  58. data/sig/telnyx/resources/ai/anthropic/v1.rbs +2 -0
  59. data/sig/telnyx/resources/ai/openai/chat.rbs +2 -0
  60. data/sig/telnyx/resources/ai/openai.rbs +2 -0
  61. data/sig/telnyx/resources/messaging_profiles.rbs +3 -1
  62. metadata +5 -2
@@ -78,6 +78,46 @@ module Telnyx
78
78
  sig { params(metadata: T::Hash[Symbol, T.anything]).void }
79
79
  attr_writer :metadata
80
80
 
81
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
82
+ # tries that region first and falls back to another when the model cannot be
83
+ # served there, so a request that would have succeeded still succeeds. `strict`
84
+ # pins the request: it is served from that region or it fails with a 422, never
85
+ # redirected to another region. Requires `region`.
86
+ sig do
87
+ returns(
88
+ T.nilable(Telnyx::AI::Anthropic::V1MessagesParams::Mode::OrSymbol)
89
+ )
90
+ end
91
+ attr_reader :mode
92
+
93
+ sig do
94
+ params(
95
+ mode: Telnyx::AI::Anthropic::V1MessagesParams::Mode::OrSymbol
96
+ ).void
97
+ end
98
+ attr_writer :mode
99
+
100
+ # Optional data-residency region the request should be served from, using the same
101
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
102
+ # Supported for Telnyx-hosted models only: a request routed to an external
103
+ # provider never passes through Telnyx model routing, so a region cannot be
104
+ # enforced for it. Omit for today's latency-based routing.
105
+ sig do
106
+ returns(
107
+ T.nilable(
108
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::OrSymbol
109
+ )
110
+ )
111
+ end
112
+ attr_reader :region
113
+
114
+ sig do
115
+ params(
116
+ region: Telnyx::AI::Anthropic::V1MessagesParams::Region::OrSymbol
117
+ ).void
118
+ end
119
+ attr_writer :region
120
+
81
121
  # The service tier to use for this request. Supported values vary by model; use
82
122
  # the Telnyx models endpoint and inspect the model's `service_tiers` field. If
83
123
  # omitted, Telnyx-hosted models use `default`.
@@ -181,6 +221,8 @@ module Telnyx
181
221
  max_retries: Integer,
182
222
  mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
183
223
  metadata: T::Hash[Symbol, T.anything],
224
+ mode: Telnyx::AI::Anthropic::V1MessagesParams::Mode::OrSymbol,
225
+ region: Telnyx::AI::Anthropic::V1MessagesParams::Region::OrSymbol,
184
226
  service_tier: String,
185
227
  stop_sequences: T::Array[String],
186
228
  stream: T::Boolean,
@@ -221,6 +263,18 @@ module Telnyx
221
263
  mcp_servers: nil,
222
264
  # An object describing metadata about the request.
223
265
  metadata: nil,
266
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
267
+ # tries that region first and falls back to another when the model cannot be
268
+ # served there, so a request that would have succeeded still succeeds. `strict`
269
+ # pins the request: it is served from that region or it fails with a 422, never
270
+ # redirected to another region. Requires `region`.
271
+ mode: nil,
272
+ # Optional data-residency region the request should be served from, using the same
273
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
274
+ # Supported for Telnyx-hosted models only: a request routed to an external
275
+ # provider never passes through Telnyx model routing, so a region cannot be
276
+ # enforced for it. Omit for today's latency-based routing.
277
+ region: nil,
224
278
  # The service tier to use for this request. Supported values vary by model; use
225
279
  # the Telnyx models endpoint and inspect the model's `service_tiers` field. If
226
280
  # omitted, Telnyx-hosted models use `default`.
@@ -264,6 +318,9 @@ module Telnyx
264
318
  max_retries: Integer,
265
319
  mcp_servers: T::Array[T::Hash[Symbol, T.anything]],
266
320
  metadata: T::Hash[Symbol, T.anything],
321
+ mode: Telnyx::AI::Anthropic::V1MessagesParams::Mode::OrSymbol,
322
+ region:
323
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::OrSymbol,
267
324
  service_tier: String,
268
325
  stop_sequences: T::Array[String],
269
326
  stream: T::Boolean,
@@ -283,6 +340,88 @@ module Telnyx
283
340
  def to_hash
284
341
  end
285
342
 
343
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
344
+ # tries that region first and falls back to another when the model cannot be
345
+ # served there, so a request that would have succeeded still succeeds. `strict`
346
+ # pins the request: it is served from that region or it fails with a 422, never
347
+ # redirected to another region. Requires `region`.
348
+ module Mode
349
+ extend Telnyx::Internal::Type::Enum
350
+
351
+ TaggedSymbol =
352
+ T.type_alias do
353
+ T.all(Symbol, Telnyx::AI::Anthropic::V1MessagesParams::Mode)
354
+ end
355
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
356
+
357
+ PREFERRED =
358
+ T.let(
359
+ :preferred,
360
+ Telnyx::AI::Anthropic::V1MessagesParams::Mode::TaggedSymbol
361
+ )
362
+ STRICT =
363
+ T.let(
364
+ :strict,
365
+ Telnyx::AI::Anthropic::V1MessagesParams::Mode::TaggedSymbol
366
+ )
367
+
368
+ sig do
369
+ override.returns(
370
+ T::Array[
371
+ Telnyx::AI::Anthropic::V1MessagesParams::Mode::TaggedSymbol
372
+ ]
373
+ )
374
+ end
375
+ def self.values
376
+ end
377
+ end
378
+
379
+ # Optional data-residency region the request should be served from, using the same
380
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
381
+ # Supported for Telnyx-hosted models only: a request routed to an external
382
+ # provider never passes through Telnyx model routing, so a region cannot be
383
+ # enforced for it. Omit for today's latency-based routing.
384
+ module Region
385
+ extend Telnyx::Internal::Type::Enum
386
+
387
+ TaggedSymbol =
388
+ T.type_alias do
389
+ T.all(Symbol, Telnyx::AI::Anthropic::V1MessagesParams::Region)
390
+ end
391
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
392
+
393
+ USA =
394
+ T.let(
395
+ :USA,
396
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::TaggedSymbol
397
+ )
398
+ EU =
399
+ T.let(
400
+ :EU,
401
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::TaggedSymbol
402
+ )
403
+ AUS =
404
+ T.let(
405
+ :AUS,
406
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::TaggedSymbol
407
+ )
408
+ UAE =
409
+ T.let(
410
+ :UAE,
411
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::TaggedSymbol
412
+ )
413
+
414
+ sig do
415
+ override.returns(
416
+ T::Array[
417
+ Telnyx::AI::Anthropic::V1MessagesParams::Region::TaggedSymbol
418
+ ]
419
+ )
420
+ end
421
+ def self.values
422
+ end
423
+ end
424
+
286
425
  # System prompt. Can be a string or an array of content blocks following the
287
426
  # Anthropic API format.
288
427
  module System
@@ -110,6 +110,21 @@ module Telnyx
110
110
  sig { params(min_p: Float).void }
111
111
  attr_writer :min_p
112
112
 
113
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
114
+ # tries that region first and falls back to another when the model cannot be
115
+ # served there, so a request that would have succeeded still succeeds. `strict`
116
+ # pins the request: it is served from that region or it fails with a 422, never
117
+ # redirected to another region. Requires `region`.
118
+ sig do
119
+ returns(T.nilable(Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol))
120
+ end
121
+ attr_reader :mode
122
+
123
+ sig do
124
+ params(mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol).void
125
+ end
126
+ attr_writer :mode
127
+
113
128
  # The language model to chat with.
114
129
  sig { returns(T.nilable(String)) }
115
130
  attr_reader :model
@@ -153,6 +168,25 @@ module Telnyx
153
168
  end
154
169
  attr_writer :reasoning_effort
155
170
 
171
+ # Optional data-residency region the request should be served from, using the same
172
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
173
+ # Supported for Telnyx-hosted models only: a request routed to an external
174
+ # provider never passes through Telnyx model routing, so a region cannot be
175
+ # enforced for it. Omit for today's latency-based routing.
176
+ sig do
177
+ returns(
178
+ T.nilable(Telnyx::AI::ChatCompletionRequest::Region::OrSymbol)
179
+ )
180
+ end
181
+ attr_reader :region
182
+
183
+ sig do
184
+ params(
185
+ region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol
186
+ ).void
187
+ end
188
+ attr_writer :region
189
+
156
190
  # Use this is you want to guarantee a JSON output without defining a schema. For
157
191
  # control over the schema, use `guided_json`.
158
192
  sig do
@@ -302,11 +336,13 @@ module Telnyx
302
336
  logprobs: T::Boolean,
303
337
  max_tokens: Integer,
304
338
  min_p: Float,
339
+ mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol,
305
340
  model: String,
306
341
  n: Float,
307
342
  presence_penalty: Float,
308
343
  reasoning_effort:
309
344
  Telnyx::AI::ChatCompletionRequest::ReasoningEffort::OrSymbol,
345
+ region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol,
310
346
  response_format:
311
347
  Telnyx::AI::ChatCompletionRequest::ResponseFormat::OrHash,
312
348
  seed: Integer,
@@ -368,6 +404,12 @@ module Telnyx
368
404
  # [many prefer](https://github.com/huggingface/transformers/issues/27670). Must be
369
405
  # in [0, 1].
370
406
  min_p: nil,
407
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
408
+ # tries that region first and falls back to another when the model cannot be
409
+ # served there, so a request that would have succeeded still succeeds. `strict`
410
+ # pins the request: it is served from that region or it fails with a 422, never
411
+ # redirected to another region. Requires `region`.
412
+ mode: nil,
371
413
  # The language model to chat with.
372
414
  model: nil,
373
415
  # This will return multiple choices for you instead of a single chat completion.
@@ -380,6 +422,12 @@ module Telnyx
380
422
  # all models support all values; unsupported values are rejected with a 400 error.
381
423
  # When omitted, reasoning models use their default effort level.
382
424
  reasoning_effort: nil,
425
+ # Optional data-residency region the request should be served from, using the same
426
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
427
+ # Supported for Telnyx-hosted models only: a request routed to an external
428
+ # provider never passes through Telnyx model routing, so a region cannot be
429
+ # enforced for it. Omit for today's latency-based routing.
430
+ region: nil,
383
431
  # Use this is you want to guarantee a JSON output without defining a schema. For
384
432
  # control over the schema, use `guided_json`.
385
433
  response_format: nil,
@@ -437,11 +485,13 @@ module Telnyx
437
485
  logprobs: T::Boolean,
438
486
  max_tokens: Integer,
439
487
  min_p: Float,
488
+ mode: Telnyx::AI::ChatCompletionRequest::Mode::OrSymbol,
440
489
  model: String,
441
490
  n: Float,
442
491
  presence_penalty: Float,
443
492
  reasoning_effort:
444
493
  Telnyx::AI::ChatCompletionRequest::ReasoningEffort::OrSymbol,
494
+ region: Telnyx::AI::ChatCompletionRequest::Region::OrSymbol,
445
495
  response_format:
446
496
  Telnyx::AI::ChatCompletionRequest::ResponseFormat,
447
497
  seed: Integer,
@@ -671,6 +721,40 @@ module Telnyx
671
721
  end
672
722
  end
673
723
 
724
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
725
+ # tries that region first and falls back to another when the model cannot be
726
+ # served there, so a request that would have succeeded still succeeds. `strict`
727
+ # pins the request: it is served from that region or it fails with a 422, never
728
+ # redirected to another region. Requires `region`.
729
+ module Mode
730
+ extend Telnyx::Internal::Type::Enum
731
+
732
+ TaggedSymbol =
733
+ T.type_alias do
734
+ T.all(Symbol, Telnyx::AI::ChatCompletionRequest::Mode)
735
+ end
736
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
737
+
738
+ PREFERRED =
739
+ T.let(
740
+ :preferred,
741
+ Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol
742
+ )
743
+ STRICT =
744
+ T.let(
745
+ :strict,
746
+ Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol
747
+ )
748
+
749
+ sig do
750
+ override.returns(
751
+ T::Array[Telnyx::AI::ChatCompletionRequest::Mode::TaggedSymbol]
752
+ )
753
+ end
754
+ def self.values
755
+ end
756
+ end
757
+
674
758
  # Controls the reasoning effort for models that support it. When set, the model
675
759
  # spends more or less compute on internal reasoning before generating its
676
760
  # response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
@@ -732,6 +816,38 @@ module Telnyx
732
816
  end
733
817
  end
734
818
 
819
+ # Optional data-residency region the request should be served from, using the same
820
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
821
+ # Supported for Telnyx-hosted models only: a request routed to an external
822
+ # provider never passes through Telnyx model routing, so a region cannot be
823
+ # enforced for it. Omit for today's latency-based routing.
824
+ module Region
825
+ extend Telnyx::Internal::Type::Enum
826
+
827
+ TaggedSymbol =
828
+ T.type_alias do
829
+ T.all(Symbol, Telnyx::AI::ChatCompletionRequest::Region)
830
+ end
831
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
832
+
833
+ USA =
834
+ T.let(:USA, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
835
+ EU =
836
+ T.let(:EU, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
837
+ AUS =
838
+ T.let(:AUS, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
839
+ UAE =
840
+ T.let(:UAE, Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol)
841
+
842
+ sig do
843
+ override.returns(
844
+ T::Array[Telnyx::AI::ChatCompletionRequest::Region::TaggedSymbol]
845
+ )
846
+ end
847
+ def self.values
848
+ end
849
+ end
850
+
735
851
  class ResponseFormat < Telnyx::Internal::Type::BaseModel
736
852
  OrHash =
737
853
  T.type_alias do
@@ -41,6 +41,25 @@ module Telnyx
41
41
  sig { params(instructions: String).void }
42
42
  attr_writer :instructions
43
43
 
44
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
45
+ # tries that region first and falls back to another when the model cannot be
46
+ # served there, so a request that would have succeeded still succeeds. `strict`
47
+ # pins the request: it is served from that region or it fails with a 422, never
48
+ # redirected to another region. Requires `region`.
49
+ sig do
50
+ returns(
51
+ T.nilable(Telnyx::AI::OpenAICreateResponseParams::Mode::OrSymbol)
52
+ )
53
+ end
54
+ attr_reader :mode
55
+
56
+ sig do
57
+ params(
58
+ mode: Telnyx::AI::OpenAICreateResponseParams::Mode::OrSymbol
59
+ ).void
60
+ end
61
+ attr_writer :mode
62
+
44
63
  # Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
45
64
  # another model available from the Telnyx OpenAI-compatible models endpoint.
46
65
  sig { returns(T.nilable(String)) }
@@ -61,6 +80,25 @@ module Telnyx
61
80
  end
62
81
  attr_writer :reasoning
63
82
 
83
+ # Optional data-residency region the request should be served from, using the same
84
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
85
+ # Supported for Telnyx-hosted models only: a request routed to an external
86
+ # provider never passes through Telnyx model routing, so a region cannot be
87
+ # enforced for it. Omit for today's latency-based routing.
88
+ sig do
89
+ returns(
90
+ T.nilable(Telnyx::AI::OpenAICreateResponseParams::Region::OrSymbol)
91
+ )
92
+ end
93
+ attr_reader :region
94
+
95
+ sig do
96
+ params(
97
+ region: Telnyx::AI::OpenAICreateResponseParams::Region::OrSymbol
98
+ ).void
99
+ end
100
+ attr_writer :region
101
+
64
102
  # The service tier to use for this request. Supported values vary by model; use
65
103
  # `GET /v2/ai/openai/models` and inspect the model's `service_tiers` field. If
66
104
  # omitted, Telnyx-hosted models use `default`.
@@ -83,9 +121,11 @@ module Telnyx
83
121
  conversation: String,
84
122
  input: T::Hash[Symbol, T.anything],
85
123
  instructions: String,
124
+ mode: Telnyx::AI::OpenAICreateResponseParams::Mode::OrSymbol,
86
125
  model: String,
87
126
  reasoning:
88
127
  Telnyx::AI::OpenAICreateResponseParams::Reasoning::OrHash,
128
+ region: Telnyx::AI::OpenAICreateResponseParams::Region::OrSymbol,
89
129
  service_tier: String,
90
130
  stream: T::Boolean,
91
131
  request_options: Telnyx::RequestOptions::OrHash
@@ -103,10 +143,22 @@ module Telnyx
103
143
  # `conversation`, send these on the first request that creates the thread;
104
144
  # subsequent turns can rely on the stored history.
105
145
  instructions: nil,
146
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
147
+ # tries that region first and falls back to another when the model cannot be
148
+ # served there, so a request that would have succeeded still succeeds. `strict`
149
+ # pins the request: it is served from that region or it fails with a 422, never
150
+ # redirected to another region. Requires `region`.
151
+ mode: nil,
106
152
  # Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
107
153
  # another model available from the Telnyx OpenAI-compatible models endpoint.
108
154
  model: nil,
109
155
  reasoning: nil,
156
+ # Optional data-residency region the request should be served from, using the same
157
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
158
+ # Supported for Telnyx-hosted models only: a request routed to an external
159
+ # provider never passes through Telnyx model routing, so a region cannot be
160
+ # enforced for it. Omit for today's latency-based routing.
161
+ region: nil,
110
162
  # The service tier to use for this request. Supported values vary by model; use
111
163
  # `GET /v2/ai/openai/models` and inspect the model's `service_tiers` field. If
112
164
  # omitted, Telnyx-hosted models use `default`.
@@ -124,8 +176,10 @@ module Telnyx
124
176
  conversation: String,
125
177
  input: T::Hash[Symbol, T.anything],
126
178
  instructions: String,
179
+ mode: Telnyx::AI::OpenAICreateResponseParams::Mode::OrSymbol,
127
180
  model: String,
128
181
  reasoning: Telnyx::AI::OpenAICreateResponseParams::Reasoning,
182
+ region: Telnyx::AI::OpenAICreateResponseParams::Region::OrSymbol,
129
183
  service_tier: String,
130
184
  stream: T::Boolean,
131
185
  request_options: Telnyx::RequestOptions
@@ -135,6 +189,42 @@ module Telnyx
135
189
  def to_hash
136
190
  end
137
191
 
192
+ # How strictly `region` is applied. `preferred` (the default when `region` is set)
193
+ # tries that region first and falls back to another when the model cannot be
194
+ # served there, so a request that would have succeeded still succeeds. `strict`
195
+ # pins the request: it is served from that region or it fails with a 422, never
196
+ # redirected to another region. Requires `region`.
197
+ module Mode
198
+ extend Telnyx::Internal::Type::Enum
199
+
200
+ TaggedSymbol =
201
+ T.type_alias do
202
+ T.all(Symbol, Telnyx::AI::OpenAICreateResponseParams::Mode)
203
+ end
204
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
205
+
206
+ PREFERRED =
207
+ T.let(
208
+ :preferred,
209
+ Telnyx::AI::OpenAICreateResponseParams::Mode::TaggedSymbol
210
+ )
211
+ STRICT =
212
+ T.let(
213
+ :strict,
214
+ Telnyx::AI::OpenAICreateResponseParams::Mode::TaggedSymbol
215
+ )
216
+
217
+ sig do
218
+ override.returns(
219
+ T::Array[
220
+ Telnyx::AI::OpenAICreateResponseParams::Mode::TaggedSymbol
221
+ ]
222
+ )
223
+ end
224
+ def self.values
225
+ end
226
+ end
227
+
138
228
  class Reasoning < Telnyx::Internal::Type::BaseModel
139
229
  OrHash =
140
230
  T.type_alias do
@@ -248,6 +338,52 @@ module Telnyx
248
338
  end
249
339
  end
250
340
  end
341
+
342
+ # Optional data-residency region the request should be served from, using the same
343
+ # vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
344
+ # Supported for Telnyx-hosted models only: a request routed to an external
345
+ # provider never passes through Telnyx model routing, so a region cannot be
346
+ # enforced for it. Omit for today's latency-based routing.
347
+ module Region
348
+ extend Telnyx::Internal::Type::Enum
349
+
350
+ TaggedSymbol =
351
+ T.type_alias do
352
+ T.all(Symbol, Telnyx::AI::OpenAICreateResponseParams::Region)
353
+ end
354
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
355
+
356
+ USA =
357
+ T.let(
358
+ :USA,
359
+ Telnyx::AI::OpenAICreateResponseParams::Region::TaggedSymbol
360
+ )
361
+ EU =
362
+ T.let(
363
+ :EU,
364
+ Telnyx::AI::OpenAICreateResponseParams::Region::TaggedSymbol
365
+ )
366
+ AUS =
367
+ T.let(
368
+ :AUS,
369
+ Telnyx::AI::OpenAICreateResponseParams::Region::TaggedSymbol
370
+ )
371
+ UAE =
372
+ T.let(
373
+ :UAE,
374
+ Telnyx::AI::OpenAICreateResponseParams::Region::TaggedSymbol
375
+ )
376
+
377
+ sig do
378
+ override.returns(
379
+ T::Array[
380
+ Telnyx::AI::OpenAICreateResponseParams::Region::TaggedSymbol
381
+ ]
382
+ )
383
+ end
384
+ def self.values
385
+ end
386
+ end
251
387
  end
252
388
  end
253
389
  end