Class: LLMDB::Tools::ListTables
- Inherits:
-
RubyLLM::Tool
- Object
- RubyLLM::Tool
- LLMDB::Tools::ListTables
- Defined in:
- lib/llmdb/tools/list_tables.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(connection) ⇒ ListTables
constructor
A new instance of ListTables.
Constructor Details
#initialize(connection) ⇒ ListTables
Returns a new instance of ListTables.
6 7 8 9 |
# File 'lib/llmdb/tools/list_tables.rb', line 6 def initialize(connection) super() @connection = connection end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/llmdb/tools/list_tables.rb', line 11 def execute tables = @connection.tables return "No tables found in the database." if tables.empty? tables.join(", ") rescue LLMDB::QueryError => e { error: e. } end |