Class: OpenAI::Models::Beta::AgentToolParam::Function

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

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 ⇒ Function

Returns a new instance of Function.

Parameters:

  • description —

    A description of what the function does.

  • name —

    The name of the function.

  • parameters —

    A JSON Schema object describing the function's arguments.

  • async —

    Whether the agent continues without waiting for the function result. Defaults to false.

  • defer_loading —

    Whether this function is deferred and discovered through tool search. Defaults to false.

  • type —

    The type of the object. Always function.

  • description: (String)
  • name: (String)
  • parameters: (::Hash[Symbol, top])
  • async: (Boolean)
  • defer_loading: (Boolean)
  • type: (:function)


69
70
71
72
73
74
75
76
# File 'sig/openai/models/beta/agent_tool_param.rbs', line 69

def initialize: (
  description: String,
  name: String,
  parameters: ::Hash[Symbol, top],
  ?async: bool,
  ?defer_loading: bool,
  ?type: :function
) -> void

Instance Attribute Details

#async ⇒ Boolean?

Whether the agent continues without waiting for the function result. Defaults to false.

Returns:



63
# File 'lib/openai/models/beta/agent_tool_param.rb', line 63

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

#defer_loading ⇒ Boolean?

Whether this function is deferred and discovered through tool search. Defaults to false.

Returns:



70
# File 'lib/openai/models/beta/agent_tool_param.rb', line 70

optional :defer_loading, OpenAI::Internal::Type::Boolean

#description ⇒ String

A description of what the function does.

Returns:

  • (String)


38
# File 'lib/openai/models/beta/agent_tool_param.rb', line 38

required :description, String

#name ⇒ String

The name of the function.

Returns:

  • (String)


44
# File 'lib/openai/models/beta/agent_tool_param.rb', line 44

required :name, String

#parameters ⇒ ::Hash[Symbol, top]

A JSON Schema object describing the function's arguments.

Returns:

  • (::Hash[Symbol, top])


50
# File 'lib/openai/models/beta/agent_tool_param.rb', line 50

required :parameters, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown]

#type ⇒ :function

The type of the object. Always function.

Returns:

  • (:function)


56
# File 'lib/openai/models/beta/agent_tool_param.rb', line 56

required :type, const: :function

Instance Method Details

#to_hash ⇒ { description: String, name: String, parameters: ::Hash[Symbol, top], ?type: :function, ?async: bool, ?defer_loading: bool }

Returns:

  • ({ description: String, name: String, parameters: ::Hash[Symbol, top], ?type: :function, ?async: bool, ?defer_loading: bool })


78
79
80
81
82
83
84
85
# File 'sig/openai/models/beta/agent_tool_param.rbs', line 78

def to_hash: -> {
  description: String,
  name: String,
  parameters: ::Hash[Symbol, top],
  ?type: :function,
  ?async: bool,
  ?defer_loading: bool
}