Class: OpenAI::Models::Chat::ChatCompletionAssistantMessageParam

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/chat/chat_completion_assistant_message_param.rb,
sig/openai/models/chat/chat_completion_assistant_message_param.rbs

Defined Under Namespace

Modules: Content Classes: Audio, FunctionCall

Instance Attribute Summary collapse

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(id:) ⇒ Object

Some parameter documentations has been truncated, see Audio for more details.

Data about a previous audio response from the model. Learn more.

Parameters:

  • id (String)

    Unique identifier for a previous audio response from the model.



# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 68

Instance Attribute Details

#audioOpenAI::Models::Chat::ChatCompletionAssistantMessageParam::Audio?

Data about a previous audio response from the model. Learn more.

Parameters:

  • value (OpenAI::Chat::ChatCompletionAssistantMessageParam::Audio, nil)

Returns:



18
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 18

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

#contentString, ...

The contents of the assistant message. Required unless tool_calls or function_call is specified.

Parameters:

  • value (OpenAI::Models::Chat::ChatCompletionAssistantMessageParam::content, nil)

Returns:



25
26
27
28
29
30
31
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 25

optional(
  :content,
  union: -> {
    OpenAI::Chat::ChatCompletionAssistantMessageParam::Content
  },
  nil?: true
)

#function_callOpenAI::Models::Chat::ChatCompletionAssistantMessageParam::FunctionCall?

Deprecated.

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

Parameters:

  • value (OpenAI::Chat::ChatCompletionAssistantMessageParam::FunctionCall, nil)

Returns:



40
41
42
43
44
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 40

optional(
  :function_call,
  -> { OpenAI::Chat::ChatCompletionAssistantMessageParam::FunctionCall },
  nil?: true
)

#nameString?

An optional name for the participant. Provides the model information to differentiate between participants of the same role.

Parameters:

  • (String)

Returns:

  • (String, nil)


51
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 51

optional :name, String

#refusalString?

The refusal message by the assistant.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


57
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 57

optional :refusal, String, nil?: true

#roleSymbol, :assistant

The role of the messages author, in this case assistant.

Parameters:

  • value (:assistant)

Returns:

  • (Symbol, :assistant)


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

required :role, const: :assistant

#tool_callsArray<OpenAI::Models::Chat::ChatCompletionMessageFunctionToolCall, OpenAI::Models::Chat::ChatCompletionMessageCustomToolCall>?

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



63
64
65
66
# File 'lib/openai/models/chat/chat_completion_assistant_message_param.rb', line 63

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

Instance Method Details

#to_hash{

Returns:

  • ({)


48
# File 'sig/openai/models/chat/chat_completion_assistant_message_param.rbs', line 48

def to_hash: -> {