Class: CircuitBreaker::Executors::LLM::Tool
- Inherits:
-
Object
- Object
- CircuitBreaker::Executors::LLM::Tool
- Defined in:
- lib/circuit_breaker/executors/llm/tools.rb
Direct Known Subclasses
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.
Instance Method Summary collapse
- #execute(**args) ⇒ Object
-
#initialize(name:, description:, parameters: {}) ⇒ Tool
constructor
A new instance of Tool.
- #to_h ⇒ Object
Constructor Details
#initialize(name:, description:, parameters: {}) ⇒ Tool
Returns a new instance of Tool.
9 10 11 12 13 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 9 def initialize(name:, description:, parameters: {}) @name = name @description = description @parameters = parameters end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 7 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 7 def name @name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
7 8 9 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 7 def parameters @parameters end |
Instance Method Details
#execute(**args) ⇒ Object
15 16 17 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 15 def execute(**args) raise NotImplementedError, "#{self.class} must implement #execute" end |
#to_h ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/circuit_breaker/executors/llm/tools.rb', line 19 def to_h { name: @name, description: @description, parameters: @parameters } end |