Class: OpenAI::Models::Responses::FunctionTool
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::Responses::FunctionTool
- Defined in:
- lib/openai/models/responses/function_tool.rb,
sig/openai/models/responses/function_tool.rbs
Defined Under Namespace
Modules: AllowedCaller
Instance Attribute Summary collapse
-
#allowed_callers ⇒ ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?
The tool invocation context(s).
- #async ⇒ Boolean?
-
#defer_loading ⇒ Boolean?
Whether this function is deferred and loaded via tool search.
-
#description ⇒ String?
A description of the function.
-
#name ⇒ String
The name of the function to call.
-
#output_schema ⇒ ::Hash[Symbol, top]?
A JSON schema object describing the JSON value encoded in string outputs for this function.
-
#parameters ⇒ ::Hash[Symbol, top]?
A JSON schema object describing the parameters of the function.
-
#strict ⇒ Boolean?
Whether strict parameter validation is enforced for this function tool.
-
#type ⇒ :function
The type of the function tool.
Attributes inherited from Internal::Type::BaseModel
Instance Method Summary collapse
-
#initialize ⇒ FunctionTool
constructor
A new instance of FunctionTool.
- #to_hash ⇒ { name: String, parameters: ::Hash[Symbol, top]?, strict: bool?, ?type: :function, ?allowed_callers: ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?, ?async: bool, ?defer_loading: bool, ?description: String?, ?output_schema: ::Hash[Symbol, top]? }
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 ⇒ FunctionTool
Returns a new instance of FunctionTool.
69 70 71 72 73 74 75 76 77 78 79 |
# File 'sig/openai/models/responses/function_tool.rbs', line 69
def initialize: (
name: String,
parameters: ::Hash[Symbol, top]?,
strict: bool?,
?allowed_callers: ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?,
?async: bool,
?defer_loading: bool,
?description: String?,
?output_schema: ::Hash[Symbol, top]?,
?type: :function
) -> void
|
Instance Attribute Details
#allowed_callers ⇒ ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?
The tool invocation context(s).
44 45 46 47 48 |
# File 'lib/openai/models/responses/function_tool.rb', line 44 optional( :allowed_callers, -> { OpenAI::Internal::Type::ArrayOf[enum: OpenAI::Responses::FunctionTool::AllowedCaller] }, nil?: true ) |
#async ⇒ Boolean?
53 |
# File 'lib/openai/models/responses/function_tool.rb', line 53 optional :async, OpenAI::Internal::Type::Boolean |
#defer_loading ⇒ Boolean?
Whether this function is deferred and loaded via tool search.
59 |
# File 'lib/openai/models/responses/function_tool.rb', line 59 optional :defer_loading, OpenAI::Internal::Type::Boolean |
#description ⇒ String?
A description of the function. Used by the model to determine whether or not to call the function.
66 |
# File 'lib/openai/models/responses/function_tool.rb', line 66 optional :description, String, nil?: true |
#name ⇒ String
The name of the function to call.
11 |
# File 'lib/openai/models/responses/function_tool.rb', line 11 required :name, String |
#output_schema ⇒ ::Hash[Symbol, top]?
A JSON schema object describing the JSON value encoded in string outputs for this function.
73 |
# File 'lib/openai/models/responses/function_tool.rb', line 73 optional :output_schema, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], nil?: true |
#parameters ⇒ ::Hash[Symbol, top]?
A JSON schema object describing the parameters of the function.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/openai/models/responses/function_tool.rb', line 17 required( :parameters, union: -> { OpenAI::UnionOf[ OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown], OpenAI::StructuredOutput::JsonSchemaConverter ] }, nil?: true ) |
#strict ⇒ Boolean?
Whether strict parameter validation is enforced for this function tool.
32 |
# File 'lib/openai/models/responses/function_tool.rb', line 32 required :strict, OpenAI::Internal::Type::Boolean, nil?: true |
#type ⇒ :function
The type of the function tool. Always function.
38 |
# File 'lib/openai/models/responses/function_tool.rb', line 38 required :type, const: :function |
Instance Method Details
#to_hash ⇒ { name: String, parameters: ::Hash[Symbol, top]?, strict: bool?, ?type: :function, ?allowed_callers: ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?, ?async: bool, ?defer_loading: bool, ?description: String?, ?output_schema: ::Hash[Symbol, top]? }
81 82 83 84 85 86 87 88 89 90 91 |
# File 'sig/openai/models/responses/function_tool.rbs', line 81
def to_hash: -> {
name: String,
parameters: ::Hash[Symbol, top]?,
strict: bool?,
?type: :function,
?allowed_callers: ::Array[OpenAI::Models::Responses::FunctionTool::allowed_caller]?,
?async: bool,
?defer_loading: bool,
?description: String?,
?output_schema: ::Hash[Symbol, top]?
}
|