Class: OpenAI::Models::Chat::ChatCompletionCustomTool::Custom

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

Overview

See Also:

  • OpenAI::Models::Chat::ChatCompletionCustomTool#custom

Defined Under Namespace

Modules: Format

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_with_error, 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) ⇒ Object

Parameters:

  • name —

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

  • description (defaults to: nil) —

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

  • format_ (defaults to: nil) —

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



# File 'lib/openai/models/chat/chat_completion_custom_tool.rb', line 54

Instance Attribute Details

#description ⇒ String?

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

Returns:

  • (String, nil)


40
# File 'lib/openai/models/chat/chat_completion_custom_tool.rb', line 40

optional :description, String

#format_ ⇒ OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_?

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

Returns:

  • (OpenAI::Models::Chat::ChatCompletionCustomTool::Custom::format_, nil)


46
47
48
49
50
51
52
# File 'lib/openai/models/chat/chat_completion_custom_tool.rb', line 46

optional(
  :format_,
  union: -> {
    OpenAI::Chat::ChatCompletionCustomTool::Custom::Format
  },
  api_name: :format
)

#name ⇒ String

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

Returns:

  • (String)


34
# File 'lib/openai/models/chat/chat_completion_custom_tool.rb', line 34

required :name, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


70
# File 'sig/openai/models/chat/chat_completion_custom_tool.rbs', line 70

def to_hash: -> {