SQL query response and text response not tallying using the SQLDatabaseChain #29250
Replies: 1 comment
-
I found two similar discussions that might be relevant to your issue:
To address the discrepancy you're experiencing, consider enabling the db_chain = SQLDatabaseChain.from_llm(gemini_llm, db, verbose=True, return_intermediate_steps=True)
response = db_chain.run("How many t-shirts do we have left for nike in extra small and white color?")
print(response["intermediate_steps"]) This will provide more detailed information about the SQL query execution and help identify where the discrepancy might be occurring. Additionally, ensure that the language model is correctly interpreting the SQL query results to generate the natural language response. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am writing a code to query data from a database using natural language.
I have set up the LLM and the database
When I write the natural language, it returns the value as expected but the text (AI) output is returning something different.
How do I fix this please
Heres the output
Beta Was this translation helpful? Give feedback.
All reactions