Class: RubyLLM::Tool::Parameter
- Inherits:
-
Object
- Object
- RubyLLM::Tool::Parameter
- Defined in:
- lib/ruby_llm/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.
8 9 10 11 12 13 |
# File 'lib/ruby_llm/tool.rb', line 8 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.
6 7 8 |
# File 'lib/ruby_llm/tool.rb', line 6 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/ruby_llm/tool.rb', line 6 def name @name end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
6 7 8 |
# File 'lib/ruby_llm/tool.rb', line 6 def required @required end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/ruby_llm/tool.rb', line 6 def type @type end |
Instance Method Details
#to_h ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ruby_llm/tool.rb', line 15 def to_h { type: type, description: description, required: required }.compact end |