Class: Ollama::Tool::Function::Parameters::Property
- Inherits:
-
Object
- Object
- Ollama::Tool::Function::Parameters::Property
- Includes:
- DTO
- Defined in:
- lib/ollama/tool/function/parameters/property.rb
Overview
A class that represents a single property within the parameters specification for a tool function.
This class encapsulates the definition of an individual parameter, including its data type, descriptive text, and optional enumeration values that define valid inputs.
Instance Attribute Summary collapse
-
#description ⇒ String
readonly
The description attribute reader returns the description associated with the object.
-
#enum ⇒ Array<String>?
readonly
The enum attribute reader returns the enumeration values associated with the object.
-
#type ⇒ String
readonly
The type attribute reader returns the type associated with the object.
Instance Method Summary collapse
-
#initialize(type:, description:, enum: nil) ⇒ Property
constructor
The initialize method sets up a new Property instance with the specified attributes.
Methods included from DTO
#==, #as_array, #as_array_of_hashes, #as_hash, #as_json, #empty?, #to_json
Constructor Details
#initialize(type:, description:, enum: nil) ⇒ Property
The initialize method sets up a new Property instance with the specified attributes.
46 47 48 |
# File 'lib/ollama/tool/function/parameters/property.rb', line 46 def initialize(type:, description:, enum: nil) @type, @description, @enum = type, description, Array(enum) end |
Instance Attribute Details
#description ⇒ String (readonly)
The description attribute reader returns the description associated with the object.
32 33 34 |
# File 'lib/ollama/tool/function/parameters/property.rb', line 32 def description @description end |
#enum ⇒ Array<String>? (readonly)
The enum attribute reader returns the enumeration values associated with the object.
property can take, or nil if not set
38 39 40 |
# File 'lib/ollama/tool/function/parameters/property.rb', line 38 def enum @enum end |
#type ⇒ String (readonly)
The type attribute reader returns the type associated with the object.
26 27 28 |
# File 'lib/ollama/tool/function/parameters/property.rb', line 26 def type @type end |