Class: OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function

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

Defined Under Namespace

Modules: AllowedCaller

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:

  • name —

    The name of the loaded function tool.

  • allowed_callers —

    The tool invocation context(s).

  • async —

    Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

  • defer_loading —

    Whether this function should be deferred and discovered via tool search.

  • output_schema —

    A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

  • strict —

    Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

  • name: (String)
  • allowed_callers: (::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller], nil)
  • async: (Boolean)
  • defer_loading: (Boolean)
  • description: (String, nil)
  • output_schema: (::Hash[Symbol, top], nil)
  • parameters: (top, nil)
  • strict: (Boolean, nil)
  • type: (:function)


121
122
123
124
125
126
127
128
129
130
131
# File 'sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs', line 121

def initialize: (
  name: String,
  ?allowed_callers: ::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller]?,
  ?async: bool,
  ?defer_loading: bool,
  ?description: String?,
  ?output_schema: ::Hash[Symbol, top]?,
  ?parameters: top?,
  ?strict: bool?,
  ?type: :function
) -> void

Instance Attribute Details

#allowed_callers ⇒ ::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller]?

The tool invocation context(s).

Returns:

  • (::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller], nil)


76
77
78
79
80
81
82
83
84
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 76

optional(
  :allowed_callers,
  -> {
    OpenAI::Internal::Type::ArrayOf[
      enum: OpenAI::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::AllowedCaller
    ]
  },
  nil?: true
)

#async ⇒ Boolean?

Whether the tool response can be returned asynchronously versus immediately returned on next response creation.

Returns:



91
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 91

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

#defer_loading ⇒ Boolean?

Whether this function should be deferred and discovered via tool search.

Returns:



97
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 97

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

#description ⇒ String?

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


102
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 102

optional :description, String, nil?: true

#name ⇒ String

The name of the loaded function tool.

Returns:

  • (String)


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

required :name, String

#output_schema ⇒ ::Hash[Symbol, top]?

A JSON Schema describing the JSON value encoded in string outputs for this function tool. This does not describe content-array outputs.

Returns:

  • (::Hash[Symbol, top], nil)


109
110
111
112
113
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 109

optional(
  :output_schema,
  OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown],
  nil?: true
)

#parameters ⇒ Object?

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


118
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 118

optional :parameters, OpenAI::Internal::Type::Unknown, nil?: true

#strict ⇒ Boolean?

Whether to enforce strict parameter validation. If omitted, Responses attempts to use strict validation when the schema is compatible, and falls back to non-strict validation otherwise.

Returns:



126
# File 'lib/openai/models/beta/beta_tool_search_output_namespace_tool.rb', line 126

optional :strict, OpenAI::Internal::Type::Boolean, nil?: true

#type ⇒ Symbol, :function

Parameters:

  • value (:function)

Returns:

  • (Symbol, :function)


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

required :type, const: :function

Instance Method Details

#to_hash ⇒ { name: String, ?type: :function, ?allowed_callers: ::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller]?, ?async: bool, ?defer_loading: bool, ?description: String?, ?output_schema: ::Hash[Symbol, top]?, ?parameters: top?, ?strict: bool? }

Returns:

  • ({ name: String, ?type: :function, ?allowed_callers: ::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller]?, ?async: bool, ?defer_loading: bool, ?description: String?, ?output_schema: ::Hash[Symbol, top]?, ?parameters: top?, ?strict: bool? })


133
134
135
136
137
138
139
140
141
142
143
# File 'sig/openai/models/beta/beta_tool_search_output_namespace_tool.rbs', line 133

def to_hash: -> {
  name: String,
  ?type: :function,
  ?allowed_callers: ::Array[OpenAI::Models::Beta::BetaToolSearchOutputNamespaceTool::Tool::Function::allowed_caller]?,
  ?async: bool,
  ?defer_loading: bool,
  ?description: String?,
  ?output_schema: ::Hash[Symbol, top]?,
  ?parameters: top?,
  ?strict: bool?
}