Class: Google::ADK::BaseTool
- Inherits:
-
Object
- Object
- Google::ADK::BaseTool
- Defined in:
- lib/google/adk/tools/base_tool.rb
Overview
Base class for all tools
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.
Instance Method Summary collapse
-
#call(params = {}) ⇒ Object
Execute the tool with given parameters.
-
#initialize(name: nil, description: nil) ⇒ BaseTool
constructor
Initialize base tool.
-
#schema ⇒ Hash
Get the tool’s parameter schema.
Constructor Details
#initialize(name: nil, description: nil) ⇒ BaseTool
Initialize base tool
13 14 15 16 |
# File 'lib/google/adk/tools/base_tool.rb', line 13 def initialize(name: nil, description: nil) @name = name @description = description end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/google/adk/tools/base_tool.rb', line 7 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/google/adk/tools/base_tool.rb', line 7 def name @name end |
Instance Method Details
#call(params = {}) ⇒ Object
Execute the tool with given parameters
22 23 24 |
# File 'lib/google/adk/tools/base_tool.rb', line 22 def call(params = {}) raise NotImplementedError, "Subclasses must implement #call" end |
#schema ⇒ Hash
Get the tool’s parameter schema
29 30 31 |
# File 'lib/google/adk/tools/base_tool.rb', line 29 def schema raise NotImplementedError, "Subclasses must implement #schema" end |