Class: Ollama::Tool::Function
- Inherits:
-
Object
- Object
- Ollama::Tool::Function
- Includes:
- DTO
- Defined in:
- lib/ollama/tool/function.rb
Defined Under Namespace
Classes: Parameters
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
Instance Method Summary collapse
-
#initialize(name:, description:, parameters: nil, required: nil) ⇒ Function
constructor
A new instance of Function.
Methods included from DTO
#as_array_of_hashes, #as_json, #empty?, #to_json
Constructor Details
#initialize(name:, description:, parameters: nil, required: nil) ⇒ Function
Returns a new instance of Function.
6 7 8 9 10 |
# File 'lib/ollama/tool/function.rb', line 6 def initialize(name:, description:, parameters: nil, required: nil) @name, @description, @parameters, @required = name, description, (Hash(parameters) if parameters), (Array(required) if required) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/ollama/tool/function.rb', line 4 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/ollama/tool/function.rb', line 4 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
4 5 6 |
# File 'lib/ollama/tool/function.rb', line 4 def parameters @parameters end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
4 5 6 |
# File 'lib/ollama/tool/function.rb', line 4 def required @required end |