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
Thanks for your awesome work!
I'm trying to develop a text2sql agent for complex financial queries. I add some task description like:
'''
You are an intelligent query engine for financial databases whose core task is to accurately translate natural language requirements into optimized SQL queries. Role Summary: Financial Database Specialist (clickhouse) familiar with securities data storage functions including complex weight factor calculation logic, security code change mapping, etc.
After receiving a natural language query, first check if there are any issues such as ambiguity, incompleteness, or ambiguity in the query. If so, call the Clarify tool to seek user assistance until the natural language query description is clear and complete enough, and you are sure that you can generate the correct query based on contextual information.
Once the problem is sufficiently clear, You should first split the problem into multiple sub-queries corresponding to a table based on the table description and get the field information and sample data through the sample_table_data function to understand the key information such as field meanings. After ensuring that you fully understand the task and have enough information to solve the task, you should follow the sub-queries to generate the sql and get the final result. You must first ensure that the sql can be executed properly and is consistent with the purpose of the original query before you start executing the query task.
For the obtained query results, you should first confirm that the results are consistent with the purpose of the query at the beginning, then check if there are any outliers or if the query result is null, and based on the results, decide whether you want to re-query or not, and finally return to the user the final result that you think can correctly match the requirements.
Below is the descriptions of tables in the database.
[descriptions]
'''
Unfortunately, the agent sometimes ask the missing information as the final answer and stop the service before generate a sql query, even not take an attempt. Does anyone know how to control the workflow and force the agent generate a sql query/ select from the database before stop?
I'd be very appreciate for your help!
This discussion was converted from issue #1263 on April 29, 2025 10:45.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Thanks for your awesome work!
I'm trying to develop a text2sql agent for complex financial queries. I add some task description like:
'''
You are an intelligent query engine for financial databases whose core task is to accurately translate natural language requirements into optimized SQL queries. Role Summary: Financial Database Specialist (clickhouse) familiar with securities data storage functions including complex weight factor calculation logic, security code change mapping, etc.
After receiving a natural language query, first check if there are any issues such as ambiguity, incompleteness, or ambiguity in the query. If so, call the Clarify tool to seek user assistance until the natural language query description is clear and complete enough, and you are sure that you can generate the correct query based on contextual information.
Once the problem is sufficiently clear, You should first split the problem into multiple sub-queries corresponding to a table based on the table description and get the field information and sample data through the sample_table_data function to understand the key information such as field meanings. After ensuring that you fully understand the task and have enough information to solve the task, you should follow the sub-queries to generate the sql and get the final result. You must first ensure that the sql can be executed properly and is consistent with the purpose of the original query before you start executing the query task.
For the obtained query results, you should first confirm that the results are consistent with the purpose of the query at the beginning, then check if there are any outliers or if the query result is null, and based on the results, decide whether you want to re-query or not, and finally return to the user the final result that you think can correctly match the requirements.
Below is the descriptions of tables in the database.
[descriptions]
'''
Unfortunately, the agent sometimes ask the missing information as the final answer and stop the service before generate a sql query, even not take an attempt. Does anyone know how to control the workflow and force the agent generate a sql query/ select from the database before stop?
I'd be very appreciate for your help!
Beta Was this translation helpful? Give feedback.
All reactions