Class: OpenAI::Models::Chat::ChatCompletionStoreMessage

Inherits:
ChatCompletionMessage show all
Defined in:
lib/openai/models/chat/chat_completion_store_message.rb,
sig/openai/models/chat/chat_completion_store_message.rbs

Defined Under Namespace

Modules: ContentPart

Instance Attribute Summary collapse

Attributes inherited from ChatCompletionMessage

#annotations, #audio, #content, #function_call, #refusal, #role, #tool_calls

Attributes inherited from Internal::Type::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], #_request_id, #_set_last_response, coerce, #deconstruct_keys, #deep_to_h, dump, #encode_with, fields, hash, #hash, inherited, #inspect, inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, coerce_with_error, dump, #dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(content:, refusal:, id:, annotations: nil, audio: nil, function_call: nil, tool_calls: nil, content_parts: nil, role: :assistant) ⇒ Object

Parameters:

  • content

    The contents of the message.

  • refusal

    The refusal message generated by the model.

  • id

    The identifier of the chat message.

  • annotations (defaults to: nil)

    Annotations for the message, when applicable, as when using the web search tool.

  • audio (defaults to: nil)

    If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.

  • function_call (defaults to: nil)

    Deprecated and replaced by tool_calls. The name and arguments of a function that should be called, as generated by the model.

  • tool_calls (defaults to: nil)

    The tool calls generated by the model, such as function calls.

  • content_parts (defaults to: nil)

    If a content parts array was provided, this is an array of text and image_url parts. Otherwise, null.

  • role (defaults to: :assistant)

    The role of the author of this message.



# File 'lib/openai/models/chat/chat_completion_store_message.rb', line 26

Instance Attribute Details

#content_parts::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part]?

If a content parts array was provided, this is an array of text and image_url parts. Otherwise, null.

Returns:

  • (::Array[OpenAI::Models::Chat::ChatCompletionStoreMessage::content_part], nil)


18
19
20
21
22
23
24
# File 'lib/openai/models/chat/chat_completion_store_message.rb', line 18

optional(
  :content_parts,
  -> {
    OpenAI::Internal::Type::ArrayOf[union: OpenAI::Chat::ChatCompletionStoreMessage::ContentPart]
  },
  nil?: true
)

#idString

The identifier of the chat message.

Returns:

  • (String)


11
# File 'lib/openai/models/chat/chat_completion_store_message.rb', line 11

required :id, String

Instance Method Details

#to_hash{

Returns:

  • ({)


71
# File 'sig/openai/models/chat/chat_completion_store_message.rbs', line 71

def to_hash: -> {