Class: OpenAI::Models::Beta::BetaResponseFunctionToolCall

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

Direct Known Subclasses

BetaResponseFunctionToolCallItem

Defined Under Namespace

Modules: Caller, Status Classes: Agent

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_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(caller_id:, type: :program) ⇒ BetaResponseFunctionToolCall

Returns a new instance of BetaResponseFunctionToolCall.

Parameters:

  • arguments —

    A JSON string of the arguments to pass to the function.

  • call_id —

    The unique ID of the function tool call generated by the model.

  • name —

    The name of the function to run.

  • id —

    The unique ID of the function tool call.

  • agent —

    The agent that produced this item.

  • async —

    Whether the function tool call runs asynchronously.

  • caller_ —

    The execution context that produced this tool call.

  • namespace —

    The namespace of the function to run.

  • status —

    The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

  • type (defaults to: :program) —

    The type of the function tool call. Always function_call.

  • arguments: (String)
  • call_id: (String)
  • name: (String)
  • id: (String)
  • agent: (OpenAI::Beta::BetaResponseFunctionToolCall::Agent, nil)
  • async: (Boolean)
  • caller_: (OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_, nil)
  • namespace: (String)
  • status: (OpenAI::Models::Beta::BetaResponseFunctionToolCall::status)
  • type: (:function_call) (defaults to: :program)


# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 73

Instance Attribute Details

#agent ⇒ OpenAI::Beta::BetaResponseFunctionToolCall::Agent?

The agent that produced this item.

Returns:

  • (OpenAI::Beta::BetaResponseFunctionToolCall::Agent, nil)


41
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 41

optional :agent, -> { OpenAI::Beta::BetaResponseFunctionToolCall::Agent }, nil?: true

#arguments ⇒ String

A JSON string of the arguments to pass to the function.

Returns:

  • (String)


11
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 11

required :arguments, String

#async ⇒ Boolean?

Whether the function tool call runs asynchronously.

Returns:



47
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 47

optional :async, OpenAI::Internal::Type::Boolean

#call_id ⇒ String

The unique ID of the function tool call generated by the model.

Returns:

  • (String)


17
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 17

required :call_id, String

#caller_ ⇒ OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_?

The execution context that produced this tool call.

Returns:

  • (OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_, nil)


53
54
55
56
57
58
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 53

optional(
  :caller_,
  union: -> { OpenAI::Beta::BetaResponseFunctionToolCall::Caller },
  api_name: :caller,
  nil?: true
)

#id ⇒ String?

The unique ID of the function tool call.

Returns:

  • (String, nil)


35
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 35

optional :id, String

#name ⇒ String

The name of the function to run.

Returns:

  • (String)


23
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 23

required :name, String

#namespace ⇒ String?

The namespace of the function to run.

Returns:

  • (String, nil)


64
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 64

optional :namespace, String

#status ⇒ OpenAI::Models::Beta::BetaResponseFunctionToolCall::status?

The status of the item. One of in_progress, completed, or incomplete. Populated when items are returned via API.

Returns:

  • (OpenAI::Models::Beta::BetaResponseFunctionToolCall::status, nil)


71
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 71

optional :status, enum: -> { OpenAI::Beta::BetaResponseFunctionToolCall::Status }

#type ⇒ :function_call

The type of the function tool call. Always function_call.

Returns:

  • (:function_call)


29
# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 29

required :type, const: :function_call

Class Method Details

.variants ⇒ Array(OpenAI::Models::Beta::BetaResponseFunctionToolCall::Caller::Direct, OpenAI::Models::Beta::BetaResponseFunctionToolCall::Caller::Program)



# File 'lib/openai/models/beta/beta_response_function_tool_call.rb', line 165

Instance Method Details

#to_hash ⇒ { arguments: String, call_id: String, name: String, ?type: :function_call, ?id: String, ?agent: OpenAI::Beta::BetaResponseFunctionToolCall::Agent?, ?async: bool, ?caller_: OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_?, ?namespace: String, ?status: OpenAI::Models::Beta::BetaResponseFunctionToolCall::status }

Returns:

  • ({ arguments: String, call_id: String, name: String, ?type: :function_call, ?id: String, ?agent: OpenAI::Beta::BetaResponseFunctionToolCall::Agent?, ?async: bool, ?caller_: OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_?, ?namespace: String, ?status: OpenAI::Models::Beta::BetaResponseFunctionToolCall::status })


101
102
103
104
105
106
107
108
109
110
111
112
# File 'sig/openai/models/beta/beta_response_function_tool_call.rbs', line 101

def to_hash: -> {
  arguments: String,
  call_id: String,
  name: String,
  ?type: :function_call,
  ?id: String,
  ?agent: OpenAI::Beta::BetaResponseFunctionToolCall::Agent?,
  ?async: bool,
  ?caller_: OpenAI::Models::Beta::BetaResponseFunctionToolCall::caller_?,
  ?namespace: String,
  ?status: OpenAI::Models::Beta::BetaResponseFunctionToolCall::status
}