Class: OpenAI::Models::Chat::ChatCompletionMessage

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/chat/chat_completion_message.rb

Direct Known Subclasses

ChatCompletionStoreMessage

Defined Under Namespace

Classes: Annotation, FunctionCall

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], 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

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, 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(end_index: , start_index: , title: , url: ) ⇒ Object

A URL citation when using web search.

Parameters:

  • end_index (Integer) (defaults to: )

    The index of the last character of the URL citation in the message.

  • start_index (Integer) (defaults to: )

    The index of the first character of the URL citation in the message.

  • title (String) (defaults to: )

    The title of the web resource.

  • url (String) (defaults to: )

    The URL of the web resource.



# File 'lib/openai/models/chat/chat_completion_message.rb', line 131

Instance Attribute Details

#annotationsArray<OpenAI::Models::Chat::ChatCompletionMessage::Annotation>?

Annotations for the message, when applicable, as when using the [web search tool](platform.openai.com/docs/guides/tools-web-search?api-mode=chat).



36
37
# File 'lib/openai/models/chat/chat_completion_message.rb', line 36

optional :annotations,
-> { OpenAI::Internal::Type::ArrayOf[OpenAI::Chat::ChatCompletionMessage::Annotation] }

#audioOpenAI::Models::Chat::ChatCompletionAudio?

If the audio output modality is requested, this object contains data about the audio response from the model. [Learn more](platform.openai.com/docs/guides/audio).



45
# File 'lib/openai/models/chat/chat_completion_message.rb', line 45

optional :audio, -> { OpenAI::Chat::ChatCompletionAudio }, nil?: true

#contentString?

The contents of the message.

Returns:

  • (String, nil)


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

required :content, String, nil?: true

#function_callOpenAI::Models::Chat::ChatCompletionMessage::FunctionCall?

Deprecated.

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



54
# File 'lib/openai/models/chat/chat_completion_message.rb', line 54

optional :function_call, -> { OpenAI::Chat::ChatCompletionMessage::FunctionCall }

#parsedObject?

The parsed contents of the message, if JSON schema is specified.

Returns:

  • (Object, nil)


17
# File 'lib/openai/models/chat/chat_completion_message.rb', line 17

optional :parsed, OpenAI::Internal::Type::Unknown

#refusalString?

The refusal message generated by the model.

Returns:

  • (String, nil)


23
# File 'lib/openai/models/chat/chat_completion_message.rb', line 23

required :refusal, String, nil?: true

#roleSymbol, :assistant

The role of the author of this message.

Returns:

  • (Symbol, :assistant)


29
# File 'lib/openai/models/chat/chat_completion_message.rb', line 29

required :role, const: :assistant

#tool_callsArray<OpenAI::Models::Chat::ChatCompletionMessageToolCall>?

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



60
61
62
63
# File 'lib/openai/models/chat/chat_completion_message.rb', line 60

optional :tool_calls,
-> {
  OpenAI::Internal::Type::ArrayOf[OpenAI::Chat::ChatCompletionMessageToolCall]
}