Class: OpenAI::Models::Beta::AgentTool::Function

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/beta/agent_tool.rb,
sig/openai/models/beta/agent_tool.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:

  • defer_loading —

    Whether the function is deferred and discovered through tool search.

  • 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.

  • type —

    The type of the object. Always function.

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


59
60
61
62
63
64
65
66
# File 'sig/openai/models/beta/agent_tool.rbs', line 59

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

Instance Attribute Details

#async ⇒ Boolean?

Whether the agent continues without waiting for the function result.

Returns:



65
# File 'lib/openai/models/beta/agent_tool.rb', line 65

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

#defer_loading ⇒ Boolean

Whether the function is deferred and discovered through tool search.

Returns:



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

required :defer_loading, OpenAI::Internal::Type::Boolean

#description ⇒ String

A description of what the function does.

Returns:

  • (String)


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

required :description, String

#name ⇒ String

The name of the function.

Returns:

  • (String)


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

required :name, String

#parameters ⇒ ::Hash[Symbol, top]

A JSON Schema object describing the function's arguments.

Returns:

  • (::Hash[Symbol, top])


53
# File 'lib/openai/models/beta/agent_tool.rb', line 53

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

#type ⇒ :function

The type of the object. Always function.

Returns:

  • (:function)


59
# File 'lib/openai/models/beta/agent_tool.rb', line 59

required :type, const: :function

Instance Method Details

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

Returns:

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


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

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