Class: OpenAI::Models::Chat::ChatCompletionNamedToolChoiceCustom

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

Defined Under Namespace

Classes: Custom

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(custom:, type: :custom) ⇒ ChatCompletionNamedToolChoiceCustom

Returns a new instance of ChatCompletionNamedToolChoiceCustom.

Parameters:

  • type (defaults to: :custom) —

    For custom tool calling, the type is always custom.

  • custom: (OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom)
  • type: (:custom) (defaults to: :custom)


# File 'lib/openai/models/chat/chat_completion_named_tool_choice_custom.rb', line 18

Instance Attribute Details

#custom ⇒ OpenAI::Models::Chat::ChatCompletionNamedToolChoiceCustom::Custom

Parameters:

  • value (OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom)

Returns:



10
# File 'lib/openai/models/chat/chat_completion_named_tool_choice_custom.rb', line 10

required :custom, -> { OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom }

#type ⇒ :custom

For custom tool calling, the type is always custom.

Returns:

  • (:custom)


16
# File 'lib/openai/models/chat/chat_completion_named_tool_choice_custom.rb', line 16

required :type, const: :custom

Instance Method Details

#to_hash ⇒ { custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom, ?type: :custom }

Returns:

  • ({ custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom, ?type: :custom })


25
26
27
28
# File 'sig/openai/models/chat/chat_completion_named_tool_choice_custom.rbs', line 25

def to_hash: -> {
  custom: OpenAI::Chat::ChatCompletionNamedToolChoiceCustom::Custom,
  ?type: :custom
}