Class: OpenAI::Models::Responses::CustomTool

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/openai/models/responses/custom_tool.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, 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, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, 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(name:, description: nil, format_: nil, type: :custom) ⇒ Object

A custom tool that processes input using a specified format. Learn more about [custom tools](platform.openai.com/docs/guides/function-calling#custom-tools)

Parameters:

  • name (String)

    The name of the custom tool, used to identify it in tool calls.

  • description (String) (defaults to: nil)

    Optional description of the custom tool, used to provide more context.

  • format_ (OpenAI::Models::CustomToolInputFormat::Text, OpenAI::Models::CustomToolInputFormat::Grammar) (defaults to: nil)

    The input format for the custom tool. Default is unconstrained text.

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

    The type of the custom tool. Always ‘custom`.



# File 'lib/openai/models/responses/custom_tool.rb', line 31

Instance Attribute Details

#descriptionString?

Optional description of the custom tool, used to provide more context.

Returns:

  • (String, nil)


23
# File 'lib/openai/models/responses/custom_tool.rb', line 23

optional :description, String

#format_OpenAI::Models::CustomToolInputFormat::Text, ...

The input format for the custom tool. Default is unconstrained text.



29
# File 'lib/openai/models/responses/custom_tool.rb', line 29

optional :format_, union: -> { OpenAI::CustomToolInputFormat }, api_name: :format

#nameString

The name of the custom tool, used to identify it in tool calls.

Returns:

  • (String)


11
# File 'lib/openai/models/responses/custom_tool.rb', line 11

required :name, String

#typeSymbol, :custom

The type of the custom tool. Always ‘custom`.

Returns:

  • (Symbol, :custom)


17
# File 'lib/openai/models/responses/custom_tool.rb', line 17

required :type, const: :custom