Class: Telnyx::Models::AI::ChatCompletionRequest::Message
Defined Under Namespace
Modules: Content, Role
Instance Attribute Summary collapse
Instance Method Summary
collapse
==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Constructor Details
#initialize(content:, role:) ⇒ Object
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 246
class Message < Telnyx::Internal::Type::BaseModel
required :content, union: -> { Telnyx::AI::ChatCompletionRequest::Message::Content }
required :role, enum: -> { Telnyx::AI::ChatCompletionRequest::Message::Role }
module Content
extend Telnyx::Internal::Type::Union
variant String
variant -> { Telnyx::Models::AI::ChatCompletionRequest::Message::Content::TextAndImage2DArray }
class TextAndImageArray < Telnyx::Internal::Type::BaseModel
required :type, enum: -> { Telnyx::AI::ChatCompletionRequest::Message::Content::TextAndImageArray::Type }
optional :image_url, String
optional :text, String
module Type
extend Telnyx::Internal::Type::Enum
TEXT = :text
IMAGE_URL = :image_url
end
end
TextAndImage2DArray =
Telnyx::Internal::Type::ArrayOf[-> {
Telnyx::AI::ChatCompletionRequest::Message::Content::TextAndImageArray
}]
end
module Role
extend Telnyx::Internal::Type::Enum
SYSTEM = :system
USER = :user
ASSISTANT = :assistant
TOOL = :tool
end
end
|
Instance Attribute Details
250
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 250
required :content, union: -> { Telnyx::AI::ChatCompletionRequest::Message::Content }
|
255
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 255
required :role, enum: -> { Telnyx::AI::ChatCompletionRequest::Message::Role }
|
Instance Method Details
#to_hash ⇒ {
219
|
# File 'sig/telnyx/models/ai/chat_completion_request.rbs', line 219
def to_hash: -> {
|