Skip to content

Commit c8f5a0a

Browse files
committed
reasonin-output
1 parent 578a6ab commit c8f5a0a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

api/agents/analysis_agent.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,13 @@ def _build_prompt( # pylint: disable=too-many-arguments, too-many-positional-a
282282
```json
283283
{{
284284
"is_sql_translatable": true or false,
285-
"instructions_comments": ("Comments about any part of the instructions, "
286-
"especially if they are unclear, impossible, "
287-
"or partially met"),
285+
"query_analysis": "OUTPUT: <exact SELECT columns required by the question (no extra columns); if the question says 'list/show all' but does not name columns, select minimal identifying columns>.\\nOUTPUT GRAIN: <state only if explicitly requested; otherwise write N/A>.\\nMETRIC: <write the exact metric expression only if explicitly requested/defined; otherwise N/A (direct column retrieval)>.\\nGRAIN CHECK: <MATCH|MISMATCH|N/A>.\\nAGGREGATION DECISION: <NONE|SUM|AVG|COUNT|MIN|MAX> (NONE unless explicitly requested).\\nRANKING/LIMIT: <ORDER BY ... LIMIT ... | NONE>.\\nFILTERS: <predicates explicitly justified by the question> (each predicate must be a concrete SQL condition using =, >, <, BETWEEN, IN; do NOT use LIKE/contains unless explicitly requested).",
288286
"explanation": ("Detailed explanation why the query can or cannot be "
289287
"translated, mentioning instructions explicitly and "
290288
"referencing conversation history if relevant"),
291-
"sql_query": ("High-level SQL query (you must to applying instructions "
292-
"and use previous answers if the question is a continuation)"),
289+
"sql_query": ("ONE valid SQL query for the target database that follows "
290+
"all rules above (use previous answers only if the question "
291+
"is a continuation)"),
293292
"tables_used": ["list", "of", "tables", "used", "in", "the", "query",
294293
"with", "the", "relationships", "between", "them"],
295294
"missing_information": ["list", "of", "missing", "information"],

0 commit comments

Comments
 (0)