I'm trying to implement an SQL LangChain agent to process an existing SQLite database. The issue I'm encountering is that the generated SQL script lacks column specifications, even though the database itself is functioning correctly.
Code:
def get_conversational_model():
model = ChatGoogleGenerativeAI(
model="gemini-1.5-flash",
temperature=0,
max_tokens=None,
timeout=None,
max_retries=2)
db = SQLDatabase.from_uri(f"sqlite:///{database}")
agent_executor = create_sql_agent(model, db=db, agent_type="openai-functions", verbose=True)
query = """
Describe the reports_details table
"""
response = agent_executor.invoke( f"Describe the {TABLE_NAME} table")
print(response)
get_conversational_model()
Output:
[SQL: SELECT FROM reports_details LIMIT ? OFFSET ?]
It appears that the issue is related to the SQLITE database, I used a different file, and script worked as expected.