You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set-up a text-to-sql agent using the template as a starting point. Here is the work flow for this agent:
When I start a new chat with the agent I can ask 2-3 questions in a row successfully. But on question 3 or 4 the Deepseek-coder element in top right of above image does not produce SQL code. It seems to hallucinate a false answer in response to the user question. Of course when this is executed as SQL code an incorrect syntax error occurs as you'd expect.
E.g.
Hypothetically the dataset relates to employees and their work location.
How many people work in london?
Correct SQL is produced, it is run successfully and the final node accurately generates a response from the HTML table output from the SQL execution.
I then ask: What are the names of these people?
The workflow works as expected and produces correct response.
But then I ask: How many people work in New York?
The SQL generation element in top right of image will try to make up a response to the question, something like 'New York has 30 employees who work there'. Not only is this not a SQL code output, but it is a complete hallucination as there are not 30 people who work out of New York. I have tried adding very strong wording to the prompt of this element so it strictly returns SQL code, but this has not helped.
Please can someone advise me as to how to ensure that my text-to-sql LLM element only returns SQL code and not a false attempt at answering the question.
The text was updated successfully, but these errors were encountered:
Ahh thank you very much, seems to have worked fine. Is there any context for why 2 is the best message window size? I played about with other numbers in there for testing and they didn't seem to work.
Describe your problem
I have set-up a text-to-sql agent using the template as a starting point. Here is the work flow for this agent:
When I start a new chat with the agent I can ask 2-3 questions in a row successfully. But on question 3 or 4 the Deepseek-coder element in top right of above image does not produce SQL code. It seems to hallucinate a false answer in response to the user question. Of course when this is executed as SQL code an incorrect syntax error occurs as you'd expect.
E.g.
Hypothetically the dataset relates to employees and their work location.
How many people work in london?
Correct SQL is produced, it is run successfully and the final node accurately generates a response from the HTML table output from the SQL execution.
I then ask: What are the names of these people?
The workflow works as expected and produces correct response.
But then I ask: How many people work in New York?
The SQL generation element in top right of image will try to make up a response to the question, something like 'New York has 30 employees who work there'. Not only is this not a SQL code output, but it is a complete hallucination as there are not 30 people who work out of New York. I have tried adding very strong wording to the prompt of this element so it strictly returns SQL code, but this has not helped.
Please can someone advise me as to how to ensure that my text-to-sql LLM element only returns SQL code and not a false attempt at answering the question.
The text was updated successfully, but these errors were encountered: