### What problem does this PR solve? #5850 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)tags/v0.17.1
| @@ -341,6 +341,7 @@ Please write the SQL, only SQL, without any other explanations or text. | |||
| nonlocal sys_prompt, user_prompt, question, tried_times | |||
| sql = chat_mdl.chat(sys_prompt, [{"role": "user", "content": user_prompt}], { | |||
| "temperature": 0.06}) | |||
| sql = re.sub(r"<think>.*</think>", "", sql, flags=re.DOTALL) | |||
| logging.debug(f"{question} ==> {user_prompt} get SQL: {sql}") | |||
| sql = re.sub(r"[\r\n]+", " ", sql.lower()) | |||
| sql = re.sub(r".*select ", "select ", sql.lower()) | |||