telnyx 5.99.0 → 5.101.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 +21 -0
- data/README.md +1 -1
- data/lib/telnyx/client.rb +5 -0
- data/lib/telnyx/models/ai/assistants/canary_deploy.rb +128 -7
- data/lib/telnyx/models/ai/assistants/canary_deploy_response.rb +131 -7
- data/lib/telnyx/models/ai/chat_create_completion_params.rb +36 -1
- data/lib/telnyx/models/ai/openai/chat_create_completion_params.rb +458 -0
- data/lib/telnyx/models/ai/openai/chat_create_completion_response.rb +12 -0
- data/lib/telnyx/models/ai/openai_list_models_params.rb +16 -0
- data/lib/telnyx/models/ai/openai_list_models_response.rb +52 -0
- data/lib/telnyx/models/uac_connection_create_params.rb +738 -0
- data/lib/telnyx/models/uac_connection_create_response.rb +898 -0
- data/lib/telnyx/models/uac_connection_delete_params.rb +20 -0
- data/lib/telnyx/models/uac_connection_delete_response.rb +898 -0
- data/lib/telnyx/models/uac_connection_list_params.rb +143 -0
- data/lib/telnyx/models/uac_connection_list_response.rb +876 -0
- data/lib/telnyx/models/uac_connection_retrieve_params.rb +20 -0
- data/lib/telnyx/models/uac_connection_retrieve_response.rb +899 -0
- data/lib/telnyx/models/uac_connection_update_params.rb +740 -0
- data/lib/telnyx/models/uac_connection_update_response.rb +898 -0
- data/lib/telnyx/models/uac_connections/action_check_registration_status_params.rb +22 -0
- data/lib/telnyx/models/uac_connections/action_check_registration_status_response.rb +104 -0
- data/lib/telnyx/models.rb +12 -0
- data/lib/telnyx/resources/ai/assistants/canary_deploys.rb +6 -10
- data/lib/telnyx/resources/ai/chat.rb +9 -2
- data/lib/telnyx/resources/ai/openai/chat.rb +96 -0
- data/lib/telnyx/resources/ai/openai.rb +26 -0
- data/lib/telnyx/resources/ai.rb +7 -5
- data/lib/telnyx/resources/uac_connections/actions.rb +39 -0
- data/lib/telnyx/resources/uac_connections.rb +256 -0
- data/lib/telnyx/version.rb +1 -1
- data/lib/telnyx.rb +19 -1
- data/rbi/telnyx/client.rbi +4 -0
- data/rbi/telnyx/models/ai/assistants/canary_deploy.rbi +303 -10
- data/rbi/telnyx/models/ai/assistants/canary_deploy_response.rbi +309 -9
- data/rbi/telnyx/models/ai/chat_create_completion_params.rbi +58 -0
- data/rbi/telnyx/models/ai/openai/chat_create_completion_params.rbi +963 -0
- data/rbi/telnyx/models/ai/openai/chat_create_completion_response.rbi +15 -0
- data/rbi/telnyx/models/ai/openai_list_models_params.rbi +29 -0
- data/rbi/telnyx/models/ai/openai_list_models_response.rbi +96 -0
- data/rbi/telnyx/models/uac_connection_create_params.rbi +1465 -0
- data/rbi/telnyx/models/uac_connection_create_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_delete_params.rbi +35 -0
- data/rbi/telnyx/models/uac_connection_delete_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_list_params.rbi +261 -0
- data/rbi/telnyx/models/uac_connection_list_response.rbi +1727 -0
- data/rbi/telnyx/models/uac_connection_retrieve_params.rbi +35 -0
- data/rbi/telnyx/models/uac_connection_retrieve_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connection_update_params.rbi +1463 -0
- data/rbi/telnyx/models/uac_connection_update_response.rbi +1793 -0
- data/rbi/telnyx/models/uac_connections/action_check_registration_status_params.rbi +40 -0
- data/rbi/telnyx/models/uac_connections/action_check_registration_status_response.rbi +237 -0
- data/rbi/telnyx/models.rbi +12 -0
- data/rbi/telnyx/resources/ai/assistants/canary_deploys.rbi +6 -14
- data/rbi/telnyx/resources/ai/chat.rbi +11 -1
- data/rbi/telnyx/resources/ai/openai/chat.rbi +147 -0
- data/rbi/telnyx/resources/ai/openai.rbi +16 -0
- data/rbi/telnyx/resources/ai.rbi +5 -5
- data/rbi/telnyx/resources/uac_connections/actions.rbi +33 -0
- data/rbi/telnyx/resources/uac_connections.rbi +348 -0
- data/sig/telnyx/client.rbs +2 -0
- data/sig/telnyx/models/ai/assistants/canary_deploy.rbs +113 -4
- data/sig/telnyx/models/ai/assistants/canary_deploy_response.rbs +113 -8
- data/sig/telnyx/models/ai/chat_create_completion_params.rbs +26 -0
- data/sig/telnyx/models/ai/openai/chat_create_completion_params.rbs +434 -0
- data/sig/telnyx/models/ai/openai/chat_create_completion_response.rbs +11 -0
- data/sig/telnyx/models/ai/openai_list_models_params.rbs +17 -0
- data/sig/telnyx/models/ai/openai_list_models_response.rbs +58 -0
- data/sig/telnyx/models/uac_connection_create_params.rbs +609 -0
- data/sig/telnyx/models/uac_connection_create_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_delete_params.rbs +20 -0
- data/sig/telnyx/models/uac_connection_delete_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_list_params.rbs +112 -0
- data/sig/telnyx/models/uac_connection_list_response.rbs +722 -0
- data/sig/telnyx/models/uac_connection_retrieve_params.rbs +20 -0
- data/sig/telnyx/models/uac_connection_retrieve_response.rbs +741 -0
- data/sig/telnyx/models/uac_connection_update_params.rbs +615 -0
- data/sig/telnyx/models/uac_connection_update_response.rbs +741 -0
- data/sig/telnyx/models/uac_connections/action_check_registration_status_params.rbs +22 -0
- data/sig/telnyx/models/uac_connections/action_check_registration_status_response.rbs +117 -0
- data/sig/telnyx/models.rbs +12 -0
- data/sig/telnyx/resources/ai/assistants/canary_deploys.rbs +2 -2
- data/sig/telnyx/resources/ai/chat.rbs +2 -0
- data/sig/telnyx/resources/ai/openai/chat.rbs +41 -0
- data/sig/telnyx/resources/ai/openai.rbs +6 -0
- data/sig/telnyx/resources/uac_connections/actions.rbs +14 -0
- data/sig/telnyx/resources/uac_connections.rbs +90 -0
- metadata +59 -5
- data/lib/telnyx/models/ai/assistants/version_config.rb +0 -30
- data/rbi/telnyx/models/ai/assistants/version_config.rbi +0 -45
- data/sig/telnyx/models/ai/assistants/version_config.rbs +0 -19
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module UacConnections
|
|
6
|
+
class ActionCheckRegistrationStatusParams < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
extend Telnyx::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Telnyx::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Telnyx::UacConnections::ActionCheckRegistrationStatusParams,
|
|
14
|
+
Telnyx::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
id: String,
|
|
24
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(id:, request_options: {})
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
{ id: String, request_options: Telnyx::RequestOptions }
|
|
33
|
+
)
|
|
34
|
+
end
|
|
35
|
+
def to_hash
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Models
|
|
5
|
+
module UacConnections
|
|
6
|
+
class ActionCheckRegistrationStatusResponse < Telnyx::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse,
|
|
11
|
+
Telnyx::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
sig do
|
|
16
|
+
returns(
|
|
17
|
+
T.nilable(
|
|
18
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data
|
|
19
|
+
)
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
attr_reader :data
|
|
23
|
+
|
|
24
|
+
sig do
|
|
25
|
+
params(
|
|
26
|
+
data:
|
|
27
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::OrHash
|
|
28
|
+
).void
|
|
29
|
+
end
|
|
30
|
+
attr_writer :data
|
|
31
|
+
|
|
32
|
+
sig do
|
|
33
|
+
params(
|
|
34
|
+
data:
|
|
35
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::OrHash
|
|
36
|
+
).returns(T.attached_class)
|
|
37
|
+
end
|
|
38
|
+
def self.new(data: nil)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
sig do
|
|
42
|
+
override.returns(
|
|
43
|
+
{
|
|
44
|
+
data:
|
|
45
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
def to_hash
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class Data < Telnyx::Internal::Type::BaseModel
|
|
53
|
+
OrHash =
|
|
54
|
+
T.type_alias do
|
|
55
|
+
T.any(
|
|
56
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data,
|
|
57
|
+
Telnyx::Internal::AnyHash
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# The ip used during the SIP connection
|
|
62
|
+
sig { returns(T.nilable(String)) }
|
|
63
|
+
attr_reader :ip_address
|
|
64
|
+
|
|
65
|
+
sig { params(ip_address: String).void }
|
|
66
|
+
attr_writer :ip_address
|
|
67
|
+
|
|
68
|
+
# ISO 8601 formatted date indicating when the resource was last updated.
|
|
69
|
+
sig { returns(T.nilable(String)) }
|
|
70
|
+
attr_reader :last_registration
|
|
71
|
+
|
|
72
|
+
sig { params(last_registration: String).void }
|
|
73
|
+
attr_writer :last_registration
|
|
74
|
+
|
|
75
|
+
# The port of the SIP connection
|
|
76
|
+
sig { returns(T.nilable(Integer)) }
|
|
77
|
+
attr_reader :port
|
|
78
|
+
|
|
79
|
+
sig { params(port: Integer).void }
|
|
80
|
+
attr_writer :port
|
|
81
|
+
|
|
82
|
+
# Identifies the type of the resource.
|
|
83
|
+
sig { returns(T.nilable(String)) }
|
|
84
|
+
attr_reader :record_type
|
|
85
|
+
|
|
86
|
+
sig { params(record_type: String).void }
|
|
87
|
+
attr_writer :record_type
|
|
88
|
+
|
|
89
|
+
# The user name of the SIP connection
|
|
90
|
+
sig { returns(T.nilable(String)) }
|
|
91
|
+
attr_reader :sip_username
|
|
92
|
+
|
|
93
|
+
sig { params(sip_username: String).void }
|
|
94
|
+
attr_writer :sip_username
|
|
95
|
+
|
|
96
|
+
# The current registration status of your SIP connection
|
|
97
|
+
sig do
|
|
98
|
+
returns(
|
|
99
|
+
T.nilable(
|
|
100
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
101
|
+
)
|
|
102
|
+
)
|
|
103
|
+
end
|
|
104
|
+
attr_reader :status
|
|
105
|
+
|
|
106
|
+
sig do
|
|
107
|
+
params(
|
|
108
|
+
status:
|
|
109
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::OrSymbol
|
|
110
|
+
).void
|
|
111
|
+
end
|
|
112
|
+
attr_writer :status
|
|
113
|
+
|
|
114
|
+
# The protocol of the SIP connection
|
|
115
|
+
sig { returns(T.nilable(String)) }
|
|
116
|
+
attr_reader :transport
|
|
117
|
+
|
|
118
|
+
sig { params(transport: String).void }
|
|
119
|
+
attr_writer :transport
|
|
120
|
+
|
|
121
|
+
# The user agent of the SIP connection
|
|
122
|
+
sig { returns(T.nilable(String)) }
|
|
123
|
+
attr_reader :user_agent
|
|
124
|
+
|
|
125
|
+
sig { params(user_agent: String).void }
|
|
126
|
+
attr_writer :user_agent
|
|
127
|
+
|
|
128
|
+
sig do
|
|
129
|
+
params(
|
|
130
|
+
ip_address: String,
|
|
131
|
+
last_registration: String,
|
|
132
|
+
port: Integer,
|
|
133
|
+
record_type: String,
|
|
134
|
+
sip_username: String,
|
|
135
|
+
status:
|
|
136
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::OrSymbol,
|
|
137
|
+
transport: String,
|
|
138
|
+
user_agent: String
|
|
139
|
+
).returns(T.attached_class)
|
|
140
|
+
end
|
|
141
|
+
def self.new(
|
|
142
|
+
# The ip used during the SIP connection
|
|
143
|
+
ip_address: nil,
|
|
144
|
+
# ISO 8601 formatted date indicating when the resource was last updated.
|
|
145
|
+
last_registration: nil,
|
|
146
|
+
# The port of the SIP connection
|
|
147
|
+
port: nil,
|
|
148
|
+
# Identifies the type of the resource.
|
|
149
|
+
record_type: nil,
|
|
150
|
+
# The user name of the SIP connection
|
|
151
|
+
sip_username: nil,
|
|
152
|
+
# The current registration status of your SIP connection
|
|
153
|
+
status: nil,
|
|
154
|
+
# The protocol of the SIP connection
|
|
155
|
+
transport: nil,
|
|
156
|
+
# The user agent of the SIP connection
|
|
157
|
+
user_agent: nil
|
|
158
|
+
)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
sig do
|
|
162
|
+
override.returns(
|
|
163
|
+
{
|
|
164
|
+
ip_address: String,
|
|
165
|
+
last_registration: String,
|
|
166
|
+
port: Integer,
|
|
167
|
+
record_type: String,
|
|
168
|
+
sip_username: String,
|
|
169
|
+
status:
|
|
170
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol,
|
|
171
|
+
transport: String,
|
|
172
|
+
user_agent: String
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
def to_hash
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# The current registration status of your SIP connection
|
|
180
|
+
module Status
|
|
181
|
+
extend Telnyx::Internal::Type::Enum
|
|
182
|
+
|
|
183
|
+
TaggedSymbol =
|
|
184
|
+
T.type_alias do
|
|
185
|
+
T.all(
|
|
186
|
+
Symbol,
|
|
187
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status
|
|
188
|
+
)
|
|
189
|
+
end
|
|
190
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
191
|
+
|
|
192
|
+
NOT_APPLICABLE =
|
|
193
|
+
T.let(
|
|
194
|
+
:"Not Applicable",
|
|
195
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
196
|
+
)
|
|
197
|
+
NOT_REGISTERED =
|
|
198
|
+
T.let(
|
|
199
|
+
:"Not Registered",
|
|
200
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
201
|
+
)
|
|
202
|
+
FAILED =
|
|
203
|
+
T.let(
|
|
204
|
+
:Failed,
|
|
205
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
206
|
+
)
|
|
207
|
+
EXPIRED =
|
|
208
|
+
T.let(
|
|
209
|
+
:Expired,
|
|
210
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
211
|
+
)
|
|
212
|
+
REGISTERED =
|
|
213
|
+
T.let(
|
|
214
|
+
:Registered,
|
|
215
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
216
|
+
)
|
|
217
|
+
UNREGISTERED =
|
|
218
|
+
T.let(
|
|
219
|
+
:Unregistered,
|
|
220
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
sig do
|
|
224
|
+
override.returns(
|
|
225
|
+
T::Array[
|
|
226
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse::Data::Status::TaggedSymbol
|
|
227
|
+
]
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
def self.values
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
end
|
|
237
|
+
end
|
data/rbi/telnyx/models.rbi
CHANGED
|
@@ -1798,6 +1798,18 @@ module Telnyx
|
|
|
1798
1798
|
|
|
1799
1799
|
TransportProtocol = Telnyx::Models::TransportProtocol
|
|
1800
1800
|
|
|
1801
|
+
UacConnectionCreateParams = Telnyx::Models::UacConnectionCreateParams
|
|
1802
|
+
|
|
1803
|
+
UacConnectionDeleteParams = Telnyx::Models::UacConnectionDeleteParams
|
|
1804
|
+
|
|
1805
|
+
UacConnectionListParams = Telnyx::Models::UacConnectionListParams
|
|
1806
|
+
|
|
1807
|
+
UacConnectionRetrieveParams = Telnyx::Models::UacConnectionRetrieveParams
|
|
1808
|
+
|
|
1809
|
+
UacConnections = Telnyx::Models::UacConnections
|
|
1810
|
+
|
|
1811
|
+
UacConnectionUpdateParams = Telnyx::Models::UacConnectionUpdateParams
|
|
1812
|
+
|
|
1801
1813
|
UnsafeUnwrapWebhookEvent = Telnyx::Models::UnsafeUnwrapWebhookEvent
|
|
1802
1814
|
|
|
1803
1815
|
UnwrapWebhookEvent = Telnyx::Models::UnwrapWebhookEvent
|
|
@@ -13,16 +13,12 @@ module Telnyx
|
|
|
13
13
|
sig do
|
|
14
14
|
params(
|
|
15
15
|
assistant_id: String,
|
|
16
|
-
|
|
16
|
+
rules:
|
|
17
|
+
T::Array[Telnyx::AI::Assistants::CanaryDeploy::Rule::OrHash],
|
|
17
18
|
request_options: Telnyx::RequestOptions::OrHash
|
|
18
19
|
).returns(Telnyx::AI::Assistants::CanaryDeployResponse)
|
|
19
20
|
end
|
|
20
|
-
def create(
|
|
21
|
-
assistant_id,
|
|
22
|
-
# List of version configurations
|
|
23
|
-
versions:,
|
|
24
|
-
request_options: {}
|
|
25
|
-
)
|
|
21
|
+
def create(assistant_id, rules: nil, request_options: {})
|
|
26
22
|
end
|
|
27
23
|
|
|
28
24
|
# Endpoint to get a canary deploy configuration for an assistant.
|
|
@@ -46,16 +42,12 @@ module Telnyx
|
|
|
46
42
|
sig do
|
|
47
43
|
params(
|
|
48
44
|
assistant_id: String,
|
|
49
|
-
|
|
45
|
+
rules:
|
|
46
|
+
T::Array[Telnyx::AI::Assistants::CanaryDeploy::Rule::OrHash],
|
|
50
47
|
request_options: Telnyx::RequestOptions::OrHash
|
|
51
48
|
).returns(Telnyx::AI::Assistants::CanaryDeployResponse)
|
|
52
49
|
end
|
|
53
|
-
def update(
|
|
54
|
-
assistant_id,
|
|
55
|
-
# List of version configurations
|
|
56
|
-
versions:,
|
|
57
|
-
request_options: {}
|
|
58
|
-
)
|
|
50
|
+
def update(assistant_id, rules: nil, request_options: {})
|
|
59
51
|
end
|
|
60
52
|
|
|
61
53
|
# Endpoint to delete a canary deploy configuration for an assistant.
|
|
@@ -5,7 +5,8 @@ module Telnyx
|
|
|
5
5
|
class AI
|
|
6
6
|
# Generate text with LLMs
|
|
7
7
|
class Chat
|
|
8
|
-
#
|
|
8
|
+
# **Deprecated**: Use `POST /v2/ai/openai/chat/completions` instead. Chat with a
|
|
9
|
+
# language model. This endpoint is consistent with the
|
|
9
10
|
# [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat)
|
|
10
11
|
# and may be used with the OpenAI JS or Python SDK.
|
|
11
12
|
sig do
|
|
@@ -29,6 +30,8 @@ module Telnyx
|
|
|
29
30
|
presence_penalty: Float,
|
|
30
31
|
response_format:
|
|
31
32
|
Telnyx::AI::ChatCreateCompletionParams::ResponseFormat::OrHash,
|
|
33
|
+
seed: Integer,
|
|
34
|
+
stop: Telnyx::AI::ChatCreateCompletionParams::Stop::Variants,
|
|
32
35
|
stream: T::Boolean,
|
|
33
36
|
temperature: Float,
|
|
34
37
|
tool_choice:
|
|
@@ -95,6 +98,13 @@ module Telnyx
|
|
|
95
98
|
# Use this is you want to guarantee a JSON output without defining a schema. For
|
|
96
99
|
# control over the schema, use `guided_json`.
|
|
97
100
|
response_format: nil,
|
|
101
|
+
# If specified, the system will make a best effort to sample deterministically,
|
|
102
|
+
# such that repeated requests with the same `seed` and parameters should return
|
|
103
|
+
# the same result.
|
|
104
|
+
seed: nil,
|
|
105
|
+
# Up to 4 sequences where the API will stop generating further tokens. The
|
|
106
|
+
# returned text will not contain the stop sequence.
|
|
107
|
+
stop: nil,
|
|
98
108
|
# Whether or not to stream data-only server-sent events as they become available.
|
|
99
109
|
stream: nil,
|
|
100
110
|
# Adjusts the "creativity" of the model. Lower values make the model more
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class AI
|
|
6
|
+
class OpenAI
|
|
7
|
+
class Chat
|
|
8
|
+
# Chat with a language model. This endpoint is consistent with the
|
|
9
|
+
# [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat)
|
|
10
|
+
# and may be used with the OpenAI JS or Python SDK by setting the base URL to
|
|
11
|
+
# `https://api.telnyx.com/v2/ai/openai`.
|
|
12
|
+
sig do
|
|
13
|
+
params(
|
|
14
|
+
messages:
|
|
15
|
+
T::Array[
|
|
16
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::Message::OrHash
|
|
17
|
+
],
|
|
18
|
+
api_key_ref: String,
|
|
19
|
+
best_of: Integer,
|
|
20
|
+
early_stopping: T::Boolean,
|
|
21
|
+
enable_thinking: T::Boolean,
|
|
22
|
+
frequency_penalty: Float,
|
|
23
|
+
guided_choice: T::Array[String],
|
|
24
|
+
guided_json: T::Hash[Symbol, T.anything],
|
|
25
|
+
guided_regex: String,
|
|
26
|
+
length_penalty: Float,
|
|
27
|
+
logprobs: T::Boolean,
|
|
28
|
+
max_tokens: Integer,
|
|
29
|
+
min_p: Float,
|
|
30
|
+
model: String,
|
|
31
|
+
n: Float,
|
|
32
|
+
presence_penalty: Float,
|
|
33
|
+
response_format:
|
|
34
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::ResponseFormat::OrHash,
|
|
35
|
+
seed: Integer,
|
|
36
|
+
stop:
|
|
37
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::Stop::Variants,
|
|
38
|
+
stream: T::Boolean,
|
|
39
|
+
temperature: Float,
|
|
40
|
+
tool_choice:
|
|
41
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::ToolChoice::OrSymbol,
|
|
42
|
+
tools:
|
|
43
|
+
T::Array[
|
|
44
|
+
T.any(
|
|
45
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::Tool::Function::OrHash,
|
|
46
|
+
Telnyx::AI::OpenAI::ChatCreateCompletionParams::Tool::Retrieval::OrHash
|
|
47
|
+
)
|
|
48
|
+
],
|
|
49
|
+
top_logprobs: Integer,
|
|
50
|
+
top_p: Float,
|
|
51
|
+
use_beam_search: T::Boolean,
|
|
52
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
53
|
+
).returns(T::Hash[Symbol, T.anything])
|
|
54
|
+
end
|
|
55
|
+
def create_completion(
|
|
56
|
+
# A list of the previous chat messages for context.
|
|
57
|
+
messages:,
|
|
58
|
+
# If you are using an external inference provider like xAI or OpenAI, this field
|
|
59
|
+
# allows you to pass along a reference to your API key. After creating an
|
|
60
|
+
# [integration secret](https://developers.telnyx.com/api-reference/integration-secrets/create-a-secret)
|
|
61
|
+
# for you API key, pass the secret's `identifier` in this field.
|
|
62
|
+
api_key_ref: nil,
|
|
63
|
+
# This is used with `use_beam_search` to determine how many candidate beams to
|
|
64
|
+
# explore.
|
|
65
|
+
best_of: nil,
|
|
66
|
+
# This is used with `use_beam_search`. If `true`, generation stops as soon as
|
|
67
|
+
# there are `best_of` complete candidates; if `false`, a heuristic is applied and
|
|
68
|
+
# the generation stops when is it very unlikely to find better candidates.
|
|
69
|
+
early_stopping: nil,
|
|
70
|
+
# Whether to enable the thinking/reasoning phase for models that support it (e.g.,
|
|
71
|
+
# QwQ, Qwen3). When set to false, the model will skip the internal reasoning step
|
|
72
|
+
# and respond directly, which can reduce latency. Defaults to true.
|
|
73
|
+
enable_thinking: nil,
|
|
74
|
+
# Higher values will penalize the model from repeating the same output tokens.
|
|
75
|
+
frequency_penalty: nil,
|
|
76
|
+
# If specified, the output will be exactly one of the choices.
|
|
77
|
+
guided_choice: nil,
|
|
78
|
+
# Must be a valid JSON schema. If specified, the output will follow the JSON
|
|
79
|
+
# schema.
|
|
80
|
+
guided_json: nil,
|
|
81
|
+
# If specified, the output will follow the regex pattern.
|
|
82
|
+
guided_regex: nil,
|
|
83
|
+
# This is used with `use_beam_search` to prefer shorter or longer completions.
|
|
84
|
+
length_penalty: nil,
|
|
85
|
+
# Whether to return log probabilities of the output tokens or not. If true,
|
|
86
|
+
# returns the log probabilities of each output token returned in the `content` of
|
|
87
|
+
# `message`.
|
|
88
|
+
logprobs: nil,
|
|
89
|
+
# Maximum number of completion tokens the model should generate.
|
|
90
|
+
max_tokens: nil,
|
|
91
|
+
# This is an alternative to `top_p` that
|
|
92
|
+
# [many prefer](https://github.com/huggingface/transformers/issues/27670). Must be
|
|
93
|
+
# in [0, 1].
|
|
94
|
+
min_p: nil,
|
|
95
|
+
# The language model to chat with.
|
|
96
|
+
model: nil,
|
|
97
|
+
# This will return multiple choices for you instead of a single chat completion.
|
|
98
|
+
n: nil,
|
|
99
|
+
# Higher values will penalize the model from repeating the same output tokens.
|
|
100
|
+
presence_penalty: nil,
|
|
101
|
+
# Use this is you want to guarantee a JSON output without defining a schema. For
|
|
102
|
+
# control over the schema, use `guided_json`.
|
|
103
|
+
response_format: nil,
|
|
104
|
+
# If specified, the system will make a best effort to sample deterministically,
|
|
105
|
+
# such that repeated requests with the same `seed` and parameters should return
|
|
106
|
+
# the same result.
|
|
107
|
+
seed: nil,
|
|
108
|
+
# Up to 4 sequences where the API will stop generating further tokens. The
|
|
109
|
+
# returned text will not contain the stop sequence.
|
|
110
|
+
stop: nil,
|
|
111
|
+
# Whether or not to stream data-only server-sent events as they become available.
|
|
112
|
+
stream: nil,
|
|
113
|
+
# Adjusts the "creativity" of the model. Lower values make the model more
|
|
114
|
+
# deterministic and repetitive, while higher values make the model more random and
|
|
115
|
+
# creative.
|
|
116
|
+
temperature: nil,
|
|
117
|
+
tool_choice: nil,
|
|
118
|
+
# The `function` tool type follows the same schema as the
|
|
119
|
+
# [OpenAI Chat Completions API](https://platform.openai.com/docs/api-reference/chat).
|
|
120
|
+
# The `retrieval` tool type is unique to Telnyx. You may pass a list of
|
|
121
|
+
# [embedded storage buckets](https://developers.telnyx.com/api-reference/embeddings/embed-documents)
|
|
122
|
+
# for retrieval-augmented generation.
|
|
123
|
+
tools: nil,
|
|
124
|
+
# This is used with `logprobs`. An integer between 0 and 20 specifying the number
|
|
125
|
+
# of most likely tokens to return at each token position, each with an associated
|
|
126
|
+
# log probability.
|
|
127
|
+
top_logprobs: nil,
|
|
128
|
+
# An alternative or complement to `temperature`. This adjusts how many of the top
|
|
129
|
+
# possibilities to consider.
|
|
130
|
+
top_p: nil,
|
|
131
|
+
# Setting this to `true` will allow the model to
|
|
132
|
+
# [explore more completion options](https://huggingface.co/blog/how-to-generate#beam-search).
|
|
133
|
+
# This is not supported by OpenAI.
|
|
134
|
+
use_beam_search: nil,
|
|
135
|
+
request_options: {}
|
|
136
|
+
)
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# @api private
|
|
140
|
+
sig { params(client: Telnyx::Client).returns(T.attached_class) }
|
|
141
|
+
def self.new(client:)
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
end
|
|
@@ -9,6 +9,22 @@ module Telnyx
|
|
|
9
9
|
sig { returns(Telnyx::Resources::AI::OpenAI::Embeddings) }
|
|
10
10
|
attr_reader :embeddings
|
|
11
11
|
|
|
12
|
+
sig { returns(Telnyx::Resources::AI::OpenAI::Chat) }
|
|
13
|
+
attr_reader :chat
|
|
14
|
+
|
|
15
|
+
# This endpoint returns a list of Open Source and OpenAI models that are available
|
|
16
|
+
# for use. <br /><br /> **Note**: Model `id`'s will be in the form
|
|
17
|
+
# `{source}/{model_name}`. For example `openai/gpt-4` or
|
|
18
|
+
# `mistralai/Mistral-7B-Instruct-v0.1` consistent with HuggingFace naming
|
|
19
|
+
# conventions.
|
|
20
|
+
sig do
|
|
21
|
+
params(request_options: Telnyx::RequestOptions::OrHash).returns(
|
|
22
|
+
Telnyx::Models::AI::OpenAIListModelsResponse
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
def list_models(request_options: {})
|
|
26
|
+
end
|
|
27
|
+
|
|
12
28
|
# @api private
|
|
13
29
|
sig { params(client: Telnyx::Client).returns(T.attached_class) }
|
|
14
30
|
def self.new(client:)
|
data/rbi/telnyx/resources/ai.rbi
CHANGED
|
@@ -46,11 +46,11 @@ module Telnyx
|
|
|
46
46
|
sig { returns(Telnyx::Resources::AI::Tools) }
|
|
47
47
|
attr_reader :tools
|
|
48
48
|
|
|
49
|
-
#
|
|
50
|
-
# for use. <br /><br />
|
|
51
|
-
# `{source}/{model_name}`. For example
|
|
52
|
-
# `mistralai/Mistral-7B-Instruct-v0.1` consistent with
|
|
53
|
-
# conventions.
|
|
49
|
+
# **Deprecated**: Use `GET /v2/ai/openai/models` instead. This endpoint returns a
|
|
50
|
+
# list of Open Source and OpenAI models that are available for use. <br /><br />
|
|
51
|
+
# **Note**: Model `id`'s will be in the form `{source}/{model_name}`. For example
|
|
52
|
+
# `openai/gpt-4` or `mistralai/Mistral-7B-Instruct-v0.1` consistent with
|
|
53
|
+
# HuggingFace naming conventions.
|
|
54
54
|
sig do
|
|
55
55
|
params(request_options: Telnyx::RequestOptions::OrHash).returns(
|
|
56
56
|
Telnyx::Models::AIRetrieveModelsResponse
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Telnyx
|
|
4
|
+
module Resources
|
|
5
|
+
class UacConnections
|
|
6
|
+
# UAC connection operations
|
|
7
|
+
class Actions
|
|
8
|
+
# Checks the registration status for a UAC connection (`registration_status`) as
|
|
9
|
+
# well as the timestamp for the last SIP registration event
|
|
10
|
+
# (`registration_status_updated_at`).
|
|
11
|
+
sig do
|
|
12
|
+
params(
|
|
13
|
+
id: String,
|
|
14
|
+
request_options: Telnyx::RequestOptions::OrHash
|
|
15
|
+
).returns(
|
|
16
|
+
Telnyx::Models::UacConnections::ActionCheckRegistrationStatusResponse
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def check_registration_status(
|
|
20
|
+
# Identifies the resource.
|
|
21
|
+
id,
|
|
22
|
+
request_options: {}
|
|
23
|
+
)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# @api private
|
|
27
|
+
sig { params(client: Telnyx::Client).returns(T.attached_class) }
|
|
28
|
+
def self.new(client:)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|