Class: RubyLLM::Parameter
- Inherits:
-
Object
- Object
- RubyLLM::Parameter
- Defined in:
- lib/ruby_llm/tool.rb
Overview
Using the existing Parameter class from Tool.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type: 'string', description: nil, required: true) ⇒ Parameter
constructor
A new instance of Parameter.
- #to_h ⇒ Object
Constructor Details
#initialize(name, type: 'string', description: nil, required: true) ⇒ Parameter
Returns a new instance of Parameter.
74 75 76 77 78 79 |
# File 'lib/ruby_llm/tool.rb', line 74 def initialize(name, type: 'string', description: nil, required: true) @name = name @type = type @description = description @required = required end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
72 73 74 |
# File 'lib/ruby_llm/tool.rb', line 72 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
72 73 74 |
# File 'lib/ruby_llm/tool.rb', line 72 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
72 73 74 |
# File 'lib/ruby_llm/tool.rb', line 72 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
72 73 74 |
# File 'lib/ruby_llm/tool.rb', line 72 def type @type end |
Instance Method Details
#to_h ⇒ Object
81 82 83 84 85 86 87 |
# File 'lib/ruby_llm/tool.rb', line 81 def to_h { type: type, description: description, required: required }.compact end |