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

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

Defined Under Namespace

Modules: Type Classes: Function

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_cached, coerce_with_error, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, resolve_type, 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) ⇒ ToolCall

Returns a new instance of ToolCall.

Parameters:

  • id —

    The ID of the tool call.

  • type —

    The type of the tool. Currently, only function is supported.

  • index: (Integer)
  • id: (String)
  • function: (OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function)
  • type: (OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::type_)


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

Instance Attribute Details

#function ⇒ OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function?

Parameters:

  • (OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function)

Returns:



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

optional :function, -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function }

#id ⇒ String?

The ID of the tool call.

Returns:

  • (String, nil)


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

optional :id, String

#index ⇒ Integer

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :index, Integer

#type ⇒ OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::type_?

The type of the tool. Currently, only function is supported.

Returns:

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


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

optional :type, enum: -> { OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Type }

Instance Method Details

#to_hash ⇒ { index: Integer, ?id: String, ?function: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function, ?type: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::type_ }

Returns:

  • ({ index: Integer, ?id: String, ?function: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function, ?type: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::type_ })


468
469
470
471
472
473
# File 'sig/openai/models/chat/chat_completion_chunk.rbs', line 468

def to_hash: -> {
  index: Integer,
  ?id: String,
  ?function: OpenAI::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::Function,
  ?type: OpenAI::Models::Chat::ChatCompletionChunk::Choice::Delta::ToolCall::type_
}