When I run the following cell, I get KeyError: 'tools'.
db = SQLDatabase.from_uri("sqlite:///./Chinook.db")
toolkit = SQLDatabaseToolkit(db=db)
agent_executor = create_sql_agent(
llm=OpenAI(temperature=0),
toolkit=toolkit,
verbose=True
)
Error originates here:
KeyError Traceback (most recent call last)
Input In [5], in <cell line: 4>()
1 db = SQLDatabase.from_uri("sqlite:///./Chinook.db")
2 toolkit = SQLDatabaseToolkit(db=db)
----> 4 agent_executor = create_sql_agent(
5 llm=OpenAI(temperature=0),
6 toolkit=toolkit,
7 verbose=True
8 )
...
...
ends here
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\main.py:339, in pydantic.main.BaseModel.init()
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\main.py:1064, in pydantic.main.validate_model()
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\agents\agent.py:565, in AgentExecutor.validate_tools(cls, values)
563 """Validate that tools are compatible with agent."""
564 agent = values["agent"]
--> 565 tools = values["tools"]
566 allowed_tools = agent.get_allowed_tools()
567 if allowed_tools is not None:
KeyError: 'tools'
Request you to please help.
When I run the following cell, I get KeyError: 'tools'.
db = SQLDatabase.from_uri("sqlite:///./Chinook.db")
toolkit = SQLDatabaseToolkit(db=db)
agent_executor = create_sql_agent(
llm=OpenAI(temperature=0),
toolkit=toolkit,
verbose=True
)
Error originates here:
KeyError Traceback (most recent call last)
Input In [5], in <cell line: 4>()
1 db = SQLDatabase.from_uri("sqlite:///./Chinook.db")
2 toolkit = SQLDatabaseToolkit(db=db)
----> 4 agent_executor = create_sql_agent(
5 llm=OpenAI(temperature=0),
6 toolkit=toolkit,
7 verbose=True
8 )
...
...
ends here
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\main.py:339, in pydantic.main.BaseModel.init()
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\pydantic\main.py:1064, in pydantic.main.validate_model()
File ~\AppData\Local\Programs\Python\Python310\lib\site-packages\langchain\agents\agent.py:565, in AgentExecutor.validate_tools(cls, values)
563 """Validate that tools are compatible with agent."""
564 agent = values["agent"]
--> 565 tools = values["tools"]
566 allowed_tools = agent.get_allowed_tools()
567 if allowed_tools is not None:
KeyError: 'tools'
Request you to please help.