MCPcopy Create free account
hub / github.com/caesarHQ/textSQL / get_initial_prompt

Function get_initial_prompt

api/app/api/utils/sql_gen/prompts.py:127–143  ·  view source on GitHub ↗

Crates the initial prompt for the given scope formatted to the given dialect and schemas. Args: dialect (str): This is something I should know what it is schemas (str): The schemas of the tables (currently formatted as CREATE TABLE...) scope (str, optional): The pro

(dialect: str, schemas: str, scope: str="USA")

Source from the content-addressed store, hash-verified

125}
126
127def get_initial_prompt(dialect: str, schemas: str, scope: str="USA") -> str:
128 """
129 Crates the initial prompt for the given scope formatted to the given dialect and schemas.
130
131 Args:
132 dialect (str): This is something I should know what it is
133 schemas (str): The schemas of the tables (currently formatted as CREATE TABLE...)
134 scope (str, optional): The project the prompt belongs to (e.g. USA, SF, etc.), defaults to 'USA'
135
136 Returns:
137 str: The formatted prompt
138 """
139 if scope in INITIAL_PROMPTS:
140 prompt = INITIAL_PROMPTS[scope]
141 else: prompt = INITIAL_PROMPTS["USA"]
142 prompt = prompt.format(dialect, schemas)
143 return prompt
144
145def get_retry_prompt(dialect: str, natural_language_query:str, scope: str="USA") -> str:
146 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected