Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 committed Nov 14, 2024
1 parent f64d504 commit f311e10
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions querybook/server/lib/ai_assistant/prompts/sql_complete_prompt.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
from langchain.prompts import PromptTemplate

prompt_template = """You are an expert in the {dialect} SQL dialect, skilled in providing precise SQL code completions.
Your task is to complete the SQL query based on the given context.
<Prefix><FILL_ME><Suffix>
===Table Schemas
{table_schemas}
===Response Guidelines:
1. Analyze the partial query and table schemas to understand the context and determine the query's goal.
2. Identify the relevant tables and columns necessary for the query.
3. Replace <FILL_ME> with appropriate SQL code, or leave it empty if no completion is needed.
prompt_template = """You are an expert in the {dialect} SQL dialect, skilled in providing precise SQL code completions.
Your task is to complete the SQL query based on the given context.
<Prefix><FILL_ME><Suffix>
===Table Schemas
{table_schemas}
===Response Guidelines:
1. Analyze the partial query and table schemas to understand the context and determine the query's goal.
2. Identify the relevant tables and columns necessary for the query.
3. Replace <FILL_ME> with appropriate SQL code, or leave it empty if no completion is needed.
4. Make sure the completion does not overlap with the prefix or suffix.
5. Respond in JSON format
===Response Format:
{{
===Response Format:
{{
"completion": "the SQL code to replace <FILL_ME>, if any"
}}
}}
===Example
Input:
sele<FILL_ME> from some_table
sele<FILL_ME> from some_table
Reasoning:
The prefix "sele" suggests that the query is likely a SELECT statement. The table schemas indicate the available columns. The completion should be a list of columns to select from the table "some_table".
Expand All @@ -35,8 +35,7 @@
}}
===Input
{prefix}<FILL_ME>{suffix}
{prefix}<FILL_ME>{suffix}
"""


Expand Down

0 comments on commit f311e10

Please sign in to comment.