Crates the retry prompt for the given scope formatted to the given dialect and schemas. Args: dialect (str): This is something I should know what it is natural_language_query (str): The natural language query that the user is trying to answer schemas (str): The sche
(dialect: str, natural_language_query:str, scope: str="USA")
| 143 | return prompt |
| 144 | |
| 145 | def get_retry_prompt(dialect: str, natural_language_query:str, scope: str="USA") -> str: |
| 146 | """ |
| 147 | Crates the retry prompt for the given scope formatted to the given dialect and schemas. |
| 148 | |
| 149 | Args: |
| 150 | dialect (str): This is something I should know what it is |
| 151 | natural_language_query (str): The natural language query that the user is trying to answer |
| 152 | schemas (str): The schemas of the tables (currently formatted as CREATE TABLE...) |
| 153 | scope (str, optional): The project the prompt belongs to (e.g. USA, SF, etc.), defaults to 'USA' |
| 154 | |
| 155 | Returns: |
| 156 | str: The formatted prompt |
| 157 | """ |
| 158 | |
| 159 | if scope in RETRY_PROMPTS2: |
| 160 | prompt = RETRY_PROMPTS2[scope] |
| 161 | else: prompt = RETRY_PROMPTS2["USA"] |
| 162 | prompt = prompt.format(dialect,natural_language_query, natural_language_query) |
| 163 | prompt = 'generation_id: ' + uuid.uuid4().hex + '\n' + prompt |
| 164 | return prompt |
no outgoing calls
no test coverage detected