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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +1 -1
- data/lib/telnyx/internal/default_flat_pagination.rb +7 -3
- data/lib/telnyx/internal/default_flat_pagination_for_inexplicit_number_orders.rb +7 -3
- data/lib/telnyx/internal/default_flat_pagination_top_level_array.rb +10 -8
- data/lib/telnyx/internal/default_pagination_for_log_messages.rb +7 -3
- data/lib/telnyx/internal/default_pagination_for_messaging_tollfree.rb +12 -3
- data/lib/telnyx/internal/default_pagination_for_queues.rb +12 -3
- data/lib/telnyx/internal/per_page_pagination.rb +8 -1
- data/lib/telnyx/internal/per_page_pagination_v2.rb +8 -1
- data/lib/telnyx/internal/type/converter.rb +2 -0
- data/lib/telnyx/models/ai/anthropic/v1_messages_params.rb +57 -1
- data/lib/telnyx/models/ai/chat_completion_request.rb +61 -1
- data/lib/telnyx/models/ai/openai_create_response_params.rb +57 -1
- data/lib/telnyx/models/messaging_messaging_profile.rb +274 -0
- data/lib/telnyx/models/messaging_profile.rb +0 -1
- data/lib/telnyx/models/messaging_profile_create_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_delete_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_retrieve_response.rb +3 -3
- data/lib/telnyx/models/messaging_profile_update_params.rb +22 -1
- data/lib/telnyx/models/messaging_profile_update_response.rb +3 -3
- data/lib/telnyx/models/messaging_profiles/action_regenerate_secret_response.rb +3 -3
- data/lib/telnyx/models.rb +2 -0
- data/lib/telnyx/resources/ai/anthropic/v1.rb +5 -1
- data/lib/telnyx/resources/ai/openai/chat.rb +5 -1
- data/lib/telnyx/resources/ai/openai.rb +5 -1
- data/lib/telnyx/resources/messaging_profiles.rb +7 -3
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +1 -0
- data/rbi/telnyx/models/ai/anthropic/v1_messages_params.rbi +139 -0
- data/rbi/telnyx/models/ai/chat_completion_request.rbi +116 -0
- data/rbi/telnyx/models/ai/openai_create_response_params.rbi +136 -0
- data/rbi/telnyx/models/messaging_messaging_profile.rbi +444 -0
- data/rbi/telnyx/models/messaging_profile.rbi +4 -6
- data/rbi/telnyx/models/messaging_profile_create_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_delete_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_retrieve_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profile_update_params.rbi +32 -0
- data/rbi/telnyx/models/messaging_profile_update_response.rbi +6 -4
- data/rbi/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbi +4 -4
- data/rbi/telnyx/models.rbi +2 -0
- data/rbi/telnyx/resources/ai/anthropic/v1.rbi +14 -0
- data/rbi/telnyx/resources/ai/openai/chat.rbi +14 -0
- data/rbi/telnyx/resources/ai/openai.rbi +14 -0
- data/rbi/telnyx/resources/messaging_profiles.rbi +14 -1
- data/sig/telnyx/models/ai/anthropic/v1_messages_params.rbs +42 -0
- data/sig/telnyx/models/ai/chat_completion_request.rbs +42 -0
- data/sig/telnyx/models/ai/openai_create_response_params.rbs +42 -0
- data/sig/telnyx/models/messaging_messaging_profile.rbs +207 -0
- data/sig/telnyx/models/messaging_profile_create_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profile_delete_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profile_retrieve_response.rbs +7 -5
- data/sig/telnyx/models/messaging_profile_update_params.rbs +14 -0
- data/sig/telnyx/models/messaging_profile_update_response.rbs +8 -5
- data/sig/telnyx/models/messaging_profiles/action_regenerate_secret_response.rbs +7 -5
- data/sig/telnyx/models.rbs +2 -0
- data/sig/telnyx/resources/ai/anthropic/v1.rbs +2 -0
- data/sig/telnyx/resources/ai/openai/chat.rbs +2 -0
- data/sig/telnyx/resources/ai/openai.rbs +2 -0
- data/sig/telnyx/resources/messaging_profiles.rbs +3 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f5a7b6ace13da0db2916ffb24b660a9962dfad65f5eb3819e213c8c597f209c
|
|
4
|
+
data.tar.gz: 644d79c57acf38c80b5999ae6dcf8f0af37f2388eb9dda400a46e278f55eb086
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8a68107acbe2ef210dd4c0805cb2942bf97b013779702c580caa0f09b5a39a571f723c83510ce42f8bc33fb22ab3b693a80076e7337554160c3183684ecbc642
|
|
7
|
+
data.tar.gz: 404495a79c4f5362bc70cd9377c5f1eb1580b5315612580c1251ffb8ff2e974111840d1134c9311bb39810e62bb66d6fd8ddfd7bf65d8a22906bbdf0c817946a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [5.167.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.166.0...v5.167.0) (2026-09-07)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* promote from staging 70ce0b1 ([83d658b](https://github.com/team-telnyx/telnyx-ruby/commit/83d658bfea2888eaab81e4e844ff159492aee43e))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **release:** remove secrets from release doctor ([#366](https://github.com/team-telnyx/telnyx-ruby/issues/366)) ([9b276d2](https://github.com/team-telnyx/telnyx-ruby/commit/9b276d2e35019aea37a8203b8634c4a7210215d4))
|
|
14
|
+
|
|
3
15
|
## [5.166.0](https://github.com/team-telnyx/telnyx-ruby/compare/v5.165.0...v5.166.0) (2026-09-01)
|
|
4
16
|
|
|
5
17
|
|
data/README.md
CHANGED
|
@@ -35,9 +35,13 @@ module Telnyx
|
|
|
35
35
|
raise RuntimeError.new(message)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
req =
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
req = @req.merge(
|
|
39
|
+
{
|
|
40
|
+
query: @req.fetch(:query, {}).except(
|
|
41
|
+
:"page[number]",
|
|
42
|
+
:"page[number]".to_s
|
|
43
|
+
).merge("page[number]": (meta&.page_number || 1).to_i.succ)
|
|
44
|
+
}
|
|
41
45
|
)
|
|
42
46
|
@client.request(req)
|
|
43
47
|
end
|
|
@@ -36,9 +36,13 @@ module Telnyx
|
|
|
36
36
|
raise RuntimeError.new(message)
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
req =
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
req = @req.merge(
|
|
40
|
+
{
|
|
41
|
+
query: @req.fetch(:query, {}).except(
|
|
42
|
+
:page_number,
|
|
43
|
+
:page_number.to_s
|
|
44
|
+
).merge(page_number: (meta&.page_number || 1).to_i.succ)
|
|
45
|
+
}
|
|
42
46
|
)
|
|
43
47
|
@client.request(req)
|
|
44
48
|
end
|
|
@@ -29,15 +29,17 @@ module Telnyx
|
|
|
29
29
|
raise RuntimeError.new(message)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
req =
|
|
33
|
-
@req,
|
|
32
|
+
req = @req.merge(
|
|
34
33
|
{
|
|
35
|
-
query: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
query: @req.fetch(:query, {}).except(
|
|
35
|
+
:"page[number]",
|
|
36
|
+
:"page[number]".to_s
|
|
37
|
+
).merge("page[number]": @req.fetch(:query, {}).fetch(
|
|
38
|
+
:"page[number]",
|
|
39
|
+
@req.fetch(:query, {}).fetch(
|
|
40
|
+
:"page[number]".to_s, 1
|
|
41
|
+
)
|
|
42
|
+
).to_i.succ)
|
|
41
43
|
}
|
|
42
44
|
)
|
|
43
45
|
@client.request(req)
|
|
@@ -35,9 +35,13 @@ module Telnyx
|
|
|
35
35
|
raise RuntimeError.new(message)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
req =
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
req = @req.merge(
|
|
39
|
+
{
|
|
40
|
+
query: @req.fetch(:query, {}).except(
|
|
41
|
+
:"page[number]",
|
|
42
|
+
:"page[number]".to_s
|
|
43
|
+
).merge("page[number]": (meta&.page_number || 1).to_i.succ)
|
|
44
|
+
}
|
|
41
45
|
)
|
|
42
46
|
@client.request(req)
|
|
43
47
|
end
|
|
@@ -35,9 +35,18 @@ module Telnyx
|
|
|
35
35
|
raise RuntimeError.new(message)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
req =
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
req = @req.merge(
|
|
39
|
+
{
|
|
40
|
+
query: @req.fetch(:query, {}).except(
|
|
41
|
+
:page,
|
|
42
|
+
:page.to_s
|
|
43
|
+
).merge(page: @req.fetch(:query, {}).fetch(
|
|
44
|
+
:page,
|
|
45
|
+
@req.fetch(:query, {}).fetch(
|
|
46
|
+
:page.to_s, 1
|
|
47
|
+
)
|
|
48
|
+
).to_i.succ)
|
|
49
|
+
}
|
|
41
50
|
)
|
|
42
51
|
@client.request(req)
|
|
43
52
|
end
|
|
@@ -32,9 +32,18 @@ module Telnyx
|
|
|
32
32
|
raise RuntimeError.new(message)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
req =
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
req = @req.merge(
|
|
36
|
+
{
|
|
37
|
+
query: @req.fetch(:query, {}).except(
|
|
38
|
+
:Page,
|
|
39
|
+
:Page.to_s
|
|
40
|
+
).merge(Page: @req.fetch(:query, {}).fetch(
|
|
41
|
+
:Page,
|
|
42
|
+
@req.fetch(:query, {}).fetch(
|
|
43
|
+
:Page.to_s, 1
|
|
44
|
+
)
|
|
45
|
+
).to_i.succ)
|
|
46
|
+
}
|
|
38
47
|
)
|
|
39
48
|
@client.request(req)
|
|
40
49
|
end
|
|
@@ -35,7 +35,14 @@ module Telnyx
|
|
|
35
35
|
raise RuntimeError.new(message)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
req =
|
|
38
|
+
req = @req.merge(
|
|
39
|
+
{
|
|
40
|
+
query: @req.fetch(:query, {}).except(
|
|
41
|
+
:page,
|
|
42
|
+
:page.to_s
|
|
43
|
+
).merge(page: (meta&.page_number || 1).to_i.succ)
|
|
44
|
+
}
|
|
45
|
+
)
|
|
39
46
|
@client.request(req)
|
|
40
47
|
end
|
|
41
48
|
|
|
@@ -38,7 +38,14 @@ module Telnyx
|
|
|
38
38
|
raise RuntimeError.new(message)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
req =
|
|
41
|
+
req = @req.merge(
|
|
42
|
+
{
|
|
43
|
+
query: @req.fetch(:query, {}).except(
|
|
44
|
+
:page,
|
|
45
|
+
:page.to_s
|
|
46
|
+
).merge(page: (page || 1).to_i.succ)
|
|
47
|
+
}
|
|
48
|
+
)
|
|
42
49
|
@client.request(req)
|
|
43
50
|
end
|
|
44
51
|
|
|
@@ -45,6 +45,8 @@ module Telnyx
|
|
|
45
45
|
value.transform_values { Telnyx::Internal::Type::Unknown.dump(_1, state: state) }
|
|
46
46
|
in Telnyx::Internal::Type::BaseModel
|
|
47
47
|
value.class.dump(value, state: state)
|
|
48
|
+
in Time
|
|
49
|
+
value.iso8601(9)
|
|
48
50
|
in StringIO
|
|
49
51
|
value.string
|
|
50
52
|
in Pathname | IO
|
|
@@ -71,6 +71,26 @@ module Telnyx
|
|
|
71
71
|
# @return [Hash{Symbol=>Object}, nil]
|
|
72
72
|
optional :metadata, Telnyx::Internal::Type::HashOf[Telnyx::Internal::Type::Unknown]
|
|
73
73
|
|
|
74
|
+
# @!attribute mode
|
|
75
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
76
|
+
# tries that region first and falls back to another when the model cannot be
|
|
77
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
78
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
79
|
+
# redirected to another region. Requires `region`.
|
|
80
|
+
#
|
|
81
|
+
# @return [Symbol, Telnyx::Models::AI::Anthropic::V1MessagesParams::Mode, nil]
|
|
82
|
+
optional :mode, enum: -> { Telnyx::AI::Anthropic::V1MessagesParams::Mode }
|
|
83
|
+
|
|
84
|
+
# @!attribute region
|
|
85
|
+
# Optional data-residency region the request should be served from, using the same
|
|
86
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
87
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
88
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
89
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
90
|
+
#
|
|
91
|
+
# @return [Symbol, Telnyx::Models::AI::Anthropic::V1MessagesParams::Region, nil]
|
|
92
|
+
optional :region, enum: -> { Telnyx::AI::Anthropic::V1MessagesParams::Region }
|
|
93
|
+
|
|
74
94
|
# @!attribute service_tier
|
|
75
95
|
# The service tier to use for this request. Supported values vary by model; use
|
|
76
96
|
# the Telnyx models endpoint and inspect the model's `service_tiers` field. If
|
|
@@ -143,7 +163,7 @@ module Telnyx
|
|
|
143
163
|
# @return [Float, nil]
|
|
144
164
|
optional :top_p, Float
|
|
145
165
|
|
|
146
|
-
# @!method initialize(max_tokens:, messages:, model:, api_key_ref: nil, billing_group_id: nil, fallback_config: nil, max_retries: nil, mcp_servers: nil, metadata: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, timeout: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
|
|
166
|
+
# @!method initialize(max_tokens:, messages:, model:, api_key_ref: nil, billing_group_id: nil, fallback_config: nil, max_retries: nil, mcp_servers: nil, metadata: nil, mode: nil, region: nil, service_tier: nil, stop_sequences: nil, stream: nil, system_: nil, temperature: nil, thinking: nil, timeout: nil, tool_choice: nil, tools: nil, top_k: nil, top_p: nil, request_options: {})
|
|
147
167
|
# Some parameter documentations has been truncated, see
|
|
148
168
|
# {Telnyx::Models::AI::Anthropic::V1MessagesParams} for more details.
|
|
149
169
|
#
|
|
@@ -165,6 +185,10 @@ module Telnyx
|
|
|
165
185
|
#
|
|
166
186
|
# @param metadata [Hash{Symbol=>Object}] An object describing metadata about the request.
|
|
167
187
|
#
|
|
188
|
+
# @param mode [Symbol, Telnyx::Models::AI::Anthropic::V1MessagesParams::Mode] How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
189
|
+
#
|
|
190
|
+
# @param region [Symbol, Telnyx::Models::AI::Anthropic::V1MessagesParams::Region] Optional data-residency region the request should be served from, using the same
|
|
191
|
+
#
|
|
168
192
|
# @param service_tier [String] The service tier to use for this request. Supported values vary by model; use th
|
|
169
193
|
#
|
|
170
194
|
# @param stop_sequences [Array<String>] Custom sequences that will cause the model to stop generating.
|
|
@@ -189,6 +213,38 @@ module Telnyx
|
|
|
189
213
|
#
|
|
190
214
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
191
215
|
|
|
216
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
217
|
+
# tries that region first and falls back to another when the model cannot be
|
|
218
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
219
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
220
|
+
# redirected to another region. Requires `region`.
|
|
221
|
+
module Mode
|
|
222
|
+
extend Telnyx::Internal::Type::Enum
|
|
223
|
+
|
|
224
|
+
PREFERRED = :preferred
|
|
225
|
+
STRICT = :strict
|
|
226
|
+
|
|
227
|
+
# @!method self.values
|
|
228
|
+
# @return [Array<Symbol>]
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Optional data-residency region the request should be served from, using the same
|
|
232
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
233
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
234
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
235
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
236
|
+
module Region
|
|
237
|
+
extend Telnyx::Internal::Type::Enum
|
|
238
|
+
|
|
239
|
+
USA = :USA
|
|
240
|
+
EU = :EU
|
|
241
|
+
AUS = :AUS
|
|
242
|
+
UAE = :UAE
|
|
243
|
+
|
|
244
|
+
# @!method self.values
|
|
245
|
+
# @return [Array<Symbol>]
|
|
246
|
+
end
|
|
247
|
+
|
|
192
248
|
# System prompt. Can be a string or an array of content blocks following the
|
|
193
249
|
# Anthropic API format.
|
|
194
250
|
module System
|
|
@@ -95,6 +95,16 @@ module Telnyx
|
|
|
95
95
|
# @return [Float, nil]
|
|
96
96
|
optional :min_p, Float
|
|
97
97
|
|
|
98
|
+
# @!attribute mode
|
|
99
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
100
|
+
# tries that region first and falls back to another when the model cannot be
|
|
101
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
102
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
103
|
+
# redirected to another region. Requires `region`.
|
|
104
|
+
#
|
|
105
|
+
# @return [Symbol, Telnyx::Models::AI::ChatCompletionRequest::Mode, nil]
|
|
106
|
+
optional :mode, enum: -> { Telnyx::AI::ChatCompletionRequest::Mode }
|
|
107
|
+
|
|
98
108
|
# @!attribute model
|
|
99
109
|
# The language model to chat with.
|
|
100
110
|
#
|
|
@@ -123,6 +133,16 @@ module Telnyx
|
|
|
123
133
|
# @return [Symbol, Telnyx::Models::AI::ChatCompletionRequest::ReasoningEffort, nil]
|
|
124
134
|
optional :reasoning_effort, enum: -> { Telnyx::AI::ChatCompletionRequest::ReasoningEffort }
|
|
125
135
|
|
|
136
|
+
# @!attribute region
|
|
137
|
+
# Optional data-residency region the request should be served from, using the same
|
|
138
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
139
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
140
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
141
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
142
|
+
#
|
|
143
|
+
# @return [Symbol, Telnyx::Models::AI::ChatCompletionRequest::Region, nil]
|
|
144
|
+
optional :region, enum: -> { Telnyx::AI::ChatCompletionRequest::Region }
|
|
145
|
+
|
|
126
146
|
# @!attribute response_format
|
|
127
147
|
# Use this is you want to guarantee a JSON output without defining a schema. For
|
|
128
148
|
# control over the schema, use `guided_json`.
|
|
@@ -205,7 +225,7 @@ module Telnyx
|
|
|
205
225
|
# @return [Boolean, nil]
|
|
206
226
|
optional :use_beam_search, Telnyx::Internal::Type::Boolean
|
|
207
227
|
|
|
208
|
-
# @!method initialize(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, model: nil, n: nil, presence_penalty: nil, reasoning_effort: nil, response_format: nil, seed: nil, service_tier: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil)
|
|
228
|
+
# @!method initialize(messages:, api_key_ref: nil, best_of: nil, early_stopping: nil, enable_thinking: nil, frequency_penalty: nil, guided_choice: nil, guided_json: nil, guided_regex: nil, length_penalty: nil, logprobs: nil, max_tokens: nil, min_p: nil, mode: nil, model: nil, n: nil, presence_penalty: nil, reasoning_effort: nil, region: nil, response_format: nil, seed: nil, service_tier: nil, stop: nil, stream: nil, temperature: nil, tool_choice: nil, tools: nil, top_logprobs: nil, top_p: nil, use_beam_search: nil)
|
|
209
229
|
# Some parameter documentations has been truncated, see
|
|
210
230
|
# {Telnyx::Models::AI::ChatCompletionRequest} for more details.
|
|
211
231
|
#
|
|
@@ -235,6 +255,8 @@ module Telnyx
|
|
|
235
255
|
#
|
|
236
256
|
# @param min_p [Float] This is an alternative to `top_p` that [many prefer](https://github.com/huggingf
|
|
237
257
|
#
|
|
258
|
+
# @param mode [Symbol, Telnyx::Models::AI::ChatCompletionRequest::Mode] How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
259
|
+
#
|
|
238
260
|
# @param model [String] The language model to chat with.
|
|
239
261
|
#
|
|
240
262
|
# @param n [Float] This will return multiple choices for you instead of a single chat completion.
|
|
@@ -243,6 +265,8 @@ module Telnyx
|
|
|
243
265
|
#
|
|
244
266
|
# @param reasoning_effort [Symbol, Telnyx::Models::AI::ChatCompletionRequest::ReasoningEffort] Controls the reasoning effort for models that support it. When set, the model sp
|
|
245
267
|
#
|
|
268
|
+
# @param region [Symbol, Telnyx::Models::AI::ChatCompletionRequest::Region] Optional data-residency region the request should be served from, using the same
|
|
269
|
+
#
|
|
246
270
|
# @param response_format [Telnyx::Models::AI::ChatCompletionRequest::ResponseFormat] Use this is you want to guarantee a JSON output without defining a schema. For c
|
|
247
271
|
#
|
|
248
272
|
# @param seed [Integer] If specified, the system will make a best effort to sample deterministically, su
|
|
@@ -345,6 +369,23 @@ module Telnyx
|
|
|
345
369
|
end
|
|
346
370
|
end
|
|
347
371
|
|
|
372
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
373
|
+
# tries that region first and falls back to another when the model cannot be
|
|
374
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
375
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
376
|
+
# redirected to another region. Requires `region`.
|
|
377
|
+
#
|
|
378
|
+
# @see Telnyx::Models::AI::ChatCompletionRequest#mode
|
|
379
|
+
module Mode
|
|
380
|
+
extend Telnyx::Internal::Type::Enum
|
|
381
|
+
|
|
382
|
+
PREFERRED = :preferred
|
|
383
|
+
STRICT = :strict
|
|
384
|
+
|
|
385
|
+
# @!method self.values
|
|
386
|
+
# @return [Array<Symbol>]
|
|
387
|
+
end
|
|
388
|
+
|
|
348
389
|
# Controls the reasoning effort for models that support it. When set, the model
|
|
349
390
|
# spends more or less compute on internal reasoning before generating its
|
|
350
391
|
# response. Supported values: none, minimal, low, medium, high, xhigh, max. Not
|
|
@@ -367,6 +408,25 @@ module Telnyx
|
|
|
367
408
|
# @return [Array<Symbol>]
|
|
368
409
|
end
|
|
369
410
|
|
|
411
|
+
# Optional data-residency region the request should be served from, using the same
|
|
412
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
413
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
414
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
415
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
416
|
+
#
|
|
417
|
+
# @see Telnyx::Models::AI::ChatCompletionRequest#region
|
|
418
|
+
module Region
|
|
419
|
+
extend Telnyx::Internal::Type::Enum
|
|
420
|
+
|
|
421
|
+
USA = :USA
|
|
422
|
+
EU = :EU
|
|
423
|
+
AUS = :AUS
|
|
424
|
+
UAE = :UAE
|
|
425
|
+
|
|
426
|
+
# @!method self.values
|
|
427
|
+
# @return [Array<Symbol>]
|
|
428
|
+
end
|
|
429
|
+
|
|
370
430
|
# @see Telnyx::Models::AI::ChatCompletionRequest#response_format
|
|
371
431
|
class ResponseFormat < Telnyx::Internal::Type::BaseModel
|
|
372
432
|
# @!attribute type
|
|
@@ -31,6 +31,16 @@ module Telnyx
|
|
|
31
31
|
# @return [String, nil]
|
|
32
32
|
optional :instructions, String
|
|
33
33
|
|
|
34
|
+
# @!attribute mode
|
|
35
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
36
|
+
# tries that region first and falls back to another when the model cannot be
|
|
37
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
38
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
39
|
+
# redirected to another region. Requires `region`.
|
|
40
|
+
#
|
|
41
|
+
# @return [Symbol, Telnyx::Models::AI::OpenAICreateResponseParams::Mode, nil]
|
|
42
|
+
optional :mode, enum: -> { Telnyx::AI::OpenAICreateResponseParams::Mode }
|
|
43
|
+
|
|
34
44
|
# @!attribute model
|
|
35
45
|
# Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or
|
|
36
46
|
# another model available from the Telnyx OpenAI-compatible models endpoint.
|
|
@@ -43,6 +53,16 @@ module Telnyx
|
|
|
43
53
|
# @return [Telnyx::Models::AI::OpenAICreateResponseParams::Reasoning, nil]
|
|
44
54
|
optional :reasoning, -> { Telnyx::AI::OpenAICreateResponseParams::Reasoning }
|
|
45
55
|
|
|
56
|
+
# @!attribute region
|
|
57
|
+
# Optional data-residency region the request should be served from, using the same
|
|
58
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
59
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
60
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
61
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
62
|
+
#
|
|
63
|
+
# @return [Symbol, Telnyx::Models::AI::OpenAICreateResponseParams::Region, nil]
|
|
64
|
+
optional :region, enum: -> { Telnyx::AI::OpenAICreateResponseParams::Region }
|
|
65
|
+
|
|
46
66
|
# @!attribute service_tier
|
|
47
67
|
# The service tier to use for this request. Supported values vary by model; use
|
|
48
68
|
# `GET /v2/ai/openai/models` and inspect the model's `service_tiers` field. If
|
|
@@ -58,7 +78,7 @@ module Telnyx
|
|
|
58
78
|
# @return [Boolean, nil]
|
|
59
79
|
optional :stream, Telnyx::Internal::Type::Boolean
|
|
60
80
|
|
|
61
|
-
# @!method initialize(conversation: nil, input: nil, instructions: nil, model: nil, reasoning: nil, service_tier: nil, stream: nil, request_options: {})
|
|
81
|
+
# @!method initialize(conversation: nil, input: nil, instructions: nil, mode: nil, model: nil, reasoning: nil, region: nil, service_tier: nil, stream: nil, request_options: {})
|
|
62
82
|
# Some parameter documentations has been truncated, see
|
|
63
83
|
# {Telnyx::Models::AI::OpenAICreateResponseParams} for more details.
|
|
64
84
|
#
|
|
@@ -68,16 +88,35 @@ module Telnyx
|
|
|
68
88
|
#
|
|
69
89
|
# @param instructions [String] Optional system/developer instructions for the model. When used with a persisted
|
|
70
90
|
#
|
|
91
|
+
# @param mode [Symbol, Telnyx::Models::AI::OpenAICreateResponseParams::Mode] How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
92
|
+
#
|
|
71
93
|
# @param model [String] Model identifier to use for the response, for example `zai-org/GLM-5.1-FP8` or a
|
|
72
94
|
#
|
|
73
95
|
# @param reasoning [Telnyx::Models::AI::OpenAICreateResponseParams::Reasoning]
|
|
74
96
|
#
|
|
97
|
+
# @param region [Symbol, Telnyx::Models::AI::OpenAICreateResponseParams::Region] Optional data-residency region the request should be served from, using the same
|
|
98
|
+
#
|
|
75
99
|
# @param service_tier [String] The service tier to use for this request. Supported values vary by model; use `G
|
|
76
100
|
#
|
|
77
101
|
# @param stream [Boolean] Set to `true` to stream Server-Sent Events, matching OpenAI's Responses streamin
|
|
78
102
|
#
|
|
79
103
|
# @param request_options [Telnyx::RequestOptions, Hash{Symbol=>Object}]
|
|
80
104
|
|
|
105
|
+
# How strictly `region` is applied. `preferred` (the default when `region` is set)
|
|
106
|
+
# tries that region first and falls back to another when the model cannot be
|
|
107
|
+
# served there, so a request that would have succeeded still succeeds. `strict`
|
|
108
|
+
# pins the request: it is served from that region or it fails with a 422, never
|
|
109
|
+
# redirected to another region. Requires `region`.
|
|
110
|
+
module Mode
|
|
111
|
+
extend Telnyx::Internal::Type::Enum
|
|
112
|
+
|
|
113
|
+
PREFERRED = :preferred
|
|
114
|
+
STRICT = :strict
|
|
115
|
+
|
|
116
|
+
# @!method self.values
|
|
117
|
+
# @return [Array<Symbol>]
|
|
118
|
+
end
|
|
119
|
+
|
|
81
120
|
class Reasoning < Telnyx::Internal::Type::BaseModel
|
|
82
121
|
# @!attribute effort
|
|
83
122
|
# Controls the reasoning effort for models that support it. Same values and
|
|
@@ -111,6 +150,23 @@ module Telnyx
|
|
|
111
150
|
# @return [Array<Symbol>]
|
|
112
151
|
end
|
|
113
152
|
end
|
|
153
|
+
|
|
154
|
+
# Optional data-residency region the request should be served from, using the same
|
|
155
|
+
# vocabulary as your account's Data Locality setting. Behavior depends on `mode`.
|
|
156
|
+
# Supported for Telnyx-hosted models only: a request routed to an external
|
|
157
|
+
# provider never passes through Telnyx model routing, so a region cannot be
|
|
158
|
+
# enforced for it. Omit for today's latency-based routing.
|
|
159
|
+
module Region
|
|
160
|
+
extend Telnyx::Internal::Type::Enum
|
|
161
|
+
|
|
162
|
+
USA = :USA
|
|
163
|
+
EU = :EU
|
|
164
|
+
AUS = :AUS
|
|
165
|
+
UAE = :UAE
|
|
166
|
+
|
|
167
|
+
# @!method self.values
|
|
168
|
+
# @return [Array<Symbol>]
|
|
169
|
+
end
|
|
114
170
|
end
|
|
115
171
|
end
|
|
116
172
|
end
|