Global Instructions Can Also Be Introduced in the "SQL Correction" Phase
I provided guidance in the global instructions on how to generate correct SQL (mainly because I observed that the LLM used some unsupported functions or syntax). However, sometimes luck isn't on our side — during the "SQL Generation" phase, it may not be possible to generate a correct SQL statement directly, leading to the "SQL Correction" phase. Since global instructions are not introduced during the "SQL Correction" phase, the corrected SQL might still be incorrect.
For example: Global instruction guidance: Do not use the xxx function During the SQL generation phase, if the generated SQL happens to be incorrect and enters the "SQL Correction" phase, if the above global instruction is not reintroduced, the LLM may use the xxx function, resulting in an SQL statement that still fails.
Hi @xpfxzxc,
That’s a great point. I'm already discussing this internally with @cyyeh. We’ll keep you updated here once there’s progress or any related changes.