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.
75 76 77 78 79 80 |
# File 'lib/ruby_llm/tool.rb', line 75 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.
73 74 75 |
# File 'lib/ruby_llm/tool.rb', line 73 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
73 74 75 |
# File 'lib/ruby_llm/tool.rb', line 73 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
73 74 75 |
# File 'lib/ruby_llm/tool.rb', line 73 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
73 74 75 |
# File 'lib/ruby_llm/tool.rb', line 73 def type @type end |
Instance Method Details
#to_h ⇒ Object
82 83 84 85 86 87 88 |
# File 'lib/ruby_llm/tool.rb', line 82 def to_h { type: type, description: description, required: required }.compact end |