submit_query_feedback
Rate the accuracy of generated SQL and supply corrected SQL when incorrect. This feedback trains the smart_query model to reduce future errors.
Instructions
Record whether the SQL produced for a question was correct, so smart_query improves over time. Behavior: stores an up/down rating; when you rate 'down' and supply the correct SQL, the error is classified and, if the same kind of mistake recurs, automatically promoted into a few-shot example. Returns the feedback id and any error type or promotion. Usage: call after reviewing smart_query/run_query output; feedback is stored locally per data_source_id and feeds the learning loop.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rating | Yes | Rating: up (correct) or down (incorrect) | |
| question | Yes | Original natural-language question | |
| correct_sql | No | Correct SQL (provide when rating=down for automatic learning) | |
| generated_sql | Yes | Generated SQL | |
| data_source_id | Yes | Data source ID |