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
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
325
326
327
328
329
330
331
332
333
334
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 256
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
260
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 260
required :content, union: -> { Telnyx::AI::ChatCompletionRequest::Message::Content }
|
265
|
# File 'lib/telnyx/models/ai/chat_completion_request.rb', line 265
required :role, enum: -> { Telnyx::AI::ChatCompletionRequest::Message::Role }
|
Instance Method Details
#to_hash ⇒ {
226
|
# File 'sig/telnyx/models/ai/chat_completion_request.rbs', line 226
def to_hash: -> {
|