MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / get_nested_sql_prompt

Function get_nested_sql_prompt

prompt/get_prompt.py:221–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

219
220
221def get_nested_sql_prompt():
222 sql_prompt = """{few_shots}### Database scheme:
223{table_info}
224
225### Please think carefully about the related fields or calculation methods of '{main_metric}', then write valid SQLite to solve the following questions based on the above table information, and do not select extra columns that are not explicitly requested in the query.
226
227### Query: {query}
228### HINT: The question may needs nested queries like INTERSECT, UNION, EXCEPT, NOT IN.
229
230### specification
2311."LIMIT" just is used when explicitly requesting how much to retrieve in the query.
2322.Don't use "IN", "OR", "LEFT JOIN" in sql because they aren't supported in execution engine, you can use "INTERSECT" or "EXCEPT" instead.
2333.In sql, just select columns that are explicitly requested in the query.
2344.The output format must strictly meet the given json specification: {{"the most related fields or calculation methods of '{main_metric}'": "zzz", "sql": "ccc"}}
235"""
236 return sql_prompt
237
238
239def get_characters_from_sql_prompt():

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected