0

I tried to ask it a simple task which involves joining two different tables and the agents seems to be including extra an ' which leads to this error (this error does not appear when the prompt is simple and just asks about one table) has anyone else encountered this problem ??


Thought: The table names are correct. I should query the schema of these tables.
Action: schema_sql_db
Action Input: 'ods_crs_reservation, ods_crs_reservation_room_history'
Observation: Error: table_names {"ods_crs_reservation_room_history'", "'ods_crs_reservation"} not found in database
Thought: I must have made a typo. I should double check the table names.
Action: list_tables_sql_db
Action Input: ""

Adam Xia
  • 53
  • 4

1 Answers1

0

I got the same error and solved it by not using the toolkit but loading the tools separately with a slight modification on the schema one

from langchain.tools.sql_database.tool import (
InfoSQLDatabaseTool,
ListSQLDatabaseTool,
QueryCheckerTool,
QuerySQLDataBaseTool,
)

# assign your llm and db

info_sql_database_tool_description = """Input to this tool is a comma separated list of tables, output is the schema and sample rows for those tables.Be sure that the tables actually exist by calling list_tables_sql_db first! Example Input: table1, table2, table3"""

tools = [
QuerySQLDataBaseTool(db=db),
InfoSQLDatabaseTool(db=db, description=info_sql_database_tool_description),
ListSQLDatabaseTool(db=db),
QueryCheckerTool(db=db, llm=llm),
]
Erymenn
  • 33
  • 4