Class: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta

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

Overview

See Also:

  • OpenAI::Models::Chat::ChatCompletionChunk::Choice#delta

Defined Under Namespace

Modules: Role Classes: FunctionCall, ToolCall

Instance Attribute Summary collapse

Attributes inherited from Internal::Type::BaseModel

#last_response

Class Method Summary collapse

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(arguments: nil, name: nil) ⇒ Object

Parameters:

  • content —

    The contents of the chunk message.

  • function_call —

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

  • refusal —

    The refusal message generated by the model.

  • role —

    The role of the author of this message.



# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 264


Instance Attribute Details

#content ⇒ String?

The contents of the chunk message.

Returns:

  • (String, nil)


233
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 233

optional :content, String, nil?: true

#function_call ⇒ OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall?

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

Returns:

  • (OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall, nil)


242
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 242

optional :function_call, -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta::FunctionCall }

#refusal ⇒ String?

The refusal message generated by the model.

Returns:

  • (String, nil)


248
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 248

optional :refusal, String, nil?: true

#role ⇒ OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::role?

The role of the author of this message.

Returns:

  • (OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::role, nil)


254
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 254

optional :role, enum: -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta::Role }

#tool_calls ⇒ Array<OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall>?



259
260
261
262
# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 259

optional(
  :tool_calls,
  -> { OpenAI::Internal::Type::ArrayOf[OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall] }
)

Class Method Details

.values ⇒ Array<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/chat/chat_completion_chunk.rb', line 327


Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


287
# File 'sig/openai/models/chat/chat_completion_chunk.rbs', line 287

def to_hash: -> {