Module: OpenAI::Models::Responses::FunctionTool::AllowedCaller

Extended by:
Internal::Type::Enum
Defined in:
lib/openai/models/responses/function_tool.rb,
sig/openai/models/responses/function_tool.rbs

Constant Summary collapse

DIRECT =

Returns:

  • (:direct)
:direct
PROGRAMMATIC =

Returns:

  • (:programmatic)
:programmatic

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Internal::Type::Enum

==, ===, coerce, dump, hash, inspect, to_sorbet_type, values

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/openai/models/responses/function_tool.rb', line 94

Instance Method Details

#initialize(name:, parameters:, strict:, allowed_callers: nil, defer_loading: nil, description: nil, output_schema: nil, type: :function) ⇒ Object

Some parameter documentations has been truncated, see OpenAI::Models::Responses::FunctionTool for more details.

Defines a function in your own code the model can choose to call. Learn more about function calling.

Parameters:

  • name (String)

    The name of the function to call.

  • parameters (Hash{Symbol=>Object}, nil)

    A JSON schema object describing the parameters of the function.

  • strict (Boolean, nil)

    Whether strict parameter validation is enforced for this function tool.

  • allowed_callers (Array<Symbol, OpenAI::Models::Responses::FunctionTool::AllowedCaller>, nil) (defaults to: nil)

    The tool invocation context(s).

  • defer_loading (Boolean) (defaults to: nil)

    Whether this function is deferred and loaded via tool search.

  • description (String, nil) (defaults to: nil)

    A description of the function. Used by the model to determine whether or not to

  • output_schema (Hash{Symbol=>Object}, nil) (defaults to: nil)

    A JSON schema object describing the JSON value encoded in string outputs for thi

  • type (Symbol, :function) (defaults to: :function)

    The type of the function tool. Always function.



88
89
90
91
92
93
94
95
96
# File 'lib/openai/models/responses/function_tool.rb', line 88

module AllowedCaller
  extend OpenAI::Internal::Type::Enum

  DIRECT = :direct
  PROGRAMMATIC = :programmatic

  # @!method self.values
  #   @return [Array<Symbol>]
end

#self?.values::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]

Returns:

  • (::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller])


65
# File 'sig/openai/models/responses/function_tool.rbs', line 65

def self?.values: -> ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]