Class: OpenAI::Models::FunctionDefinition
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- OpenAI::Models::FunctionDefinition
- Defined in:
- lib/openai/models/function_definition.rb
Instance Attribute Summary collapse
-
#description ⇒ String?
A description of what the function does, used by the model to choose when and how to call the function.
-
#name ⇒ String
The name of the function to be called.
-
#parameters ⇒ Hash{Symbol=>Object}?
The parameters the functions accepts, described as a JSON Schema object.
-
#strict ⇒ Boolean?
Whether to enable strict schema adherence when generating the function call.
Instance Method Summary collapse
-
#initialize(name: , description: nil, parameters: nil, strict: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see FunctionDefinition for more details.
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, 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, parameters: nil, strict: nil) ⇒ Object
Some parameter documentations has been truncated, see OpenAI::Models::FunctionDefinition for more details.
|
# File 'lib/openai/models/function_definition.rb', line 42
|
Instance Attribute Details
#description ⇒ String?
A description of what the function does, used by the model to choose when and how to call the function.
18 |
# File 'lib/openai/models/function_definition.rb', line 18 optional :description, String |
#name ⇒ String
The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
11 |
# File 'lib/openai/models/function_definition.rb', line 11 required :name, String |
#parameters ⇒ Hash{Symbol=>Object}?
The parameters the functions accepts, described as a JSON Schema object. See the [guide](platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](json-schema.org/understanding-json-schema/) for documentation about the format.
Omitting ‘parameters` defines a function with an empty parameter list.
30 |
# File 'lib/openai/models/function_definition.rb', line 30 optional :parameters, OpenAI::Internal::Type::HashOf[OpenAI::Internal::Type::Unknown] |
#strict ⇒ Boolean?
Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the ‘parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](docs/guides/function-calling).
40 |
# File 'lib/openai/models/function_definition.rb', line 40 optional :strict, OpenAI::Internal::Type::Boolean, nil?: true |