fix: SQLAgent

The queryCheckerTool now needs an extra arg with the LLM instance: https://github.com/hwchase17/langchain/blob/master/langchain/tools/sql_database/tool.py#L108

I added it so the SQLAgent can work normally now
This commit is contained in:
Gabriel Ferreira Rosalino 2023-05-27 14:12:18 -03:00 committed by GitHub
commit f44e2f97f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -220,7 +220,7 @@ class SQLAgent(CustomAgentExecutor):
QuerySQLDataBaseTool(db=db), # type: ignore
InfoSQLDatabaseTool(db=db), # type: ignore
ListSQLDatabaseTool(db=db), # type: ignore
QueryCheckerTool(db=db, llm_chain=llmchain), # type: ignore
QueryCheckerTool(db=db, llm_chain=llmchain, llm=llm), # type: ignore
]
prefix = SQL_PREFIX.format(dialect=toolkit.dialect, top_k=10)