langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
94.12k stars 15.21k forks source link

#error: ValidationError: 1 validation error for SQLDatabaseToolkit #20213

Closed ankitk074 closed 2 months ago

ankitk074 commented 6 months ago

Checked other resources

Example Code

model = genai.GenerativeModel(model_name='gemini-pro')

llm = OpenAI(temperature=0)

mydb = SQLDatabase.from_uri('sqlite:///test.db')

llm = {'model': model} toolkit=SQLDatabaseToolkit(db=mydb) agent_executer = create_sql_agent( llm=llm, toolkit=toolkit, handle_parsing_error=True, verbose=True )

Error Message and Stack Trace (if applicable)

No response

Description

Getting same issue , in my case issue is not getting resolved , is it because i am using gemini or different model from OpenAI, even i have followed all the recomendations from the chat , but still it is same, how to resolve the same issue using gemini pro model? genai.configure(api_key='my Api key')

System Info

import streamlit as st import pandas as pd import google.generativeai as genai from langchain_community.agent_toolkits import SQLDatabaseToolkit from langchain.agents.agent_types import AgentType from langchain.sql_database import SQLDatabase

i have used above imoorts

mkennedy-clgx commented 6 months ago

I am having the same issue using toolkit = SQLDatabaseToolkit(db=db, llm=GenerativeModel( "gemini-1.0-pro", generation_config={"temperature": 0}, ))

oakdatamechanic commented 5 months ago

I am facing the same issue, Is it supported or you guys are working on the updates?