Skip to content

Commit

Permalink
chore(wren-ai-service): minor updates (#721)
Browse files Browse the repository at this point in the history
* fix overriding config.yaml

* fix struct as column issue
  • Loading branch information
cyyeh authored Oct 4, 2024
1 parent d9f86e6 commit d99bed8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 2 additions & 3 deletions wren-ai-service/demo/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def _replace_wren_engine_env_variables(engine_type: str, data: dict):
with open(".env.dev", "w") as f:
f.writelines(lines)
else:
with open("config.yaml", "r+") as f:
with open("config.yaml", "r") as f:
configs = list(yaml.safe_load_all(f))

for config in configs:
Expand All @@ -610,8 +610,7 @@ def _replace_wren_engine_env_variables(engine_type: str, data: dict):
if "engine" in pipe:
config["pipes"][i]["engine"] = engine_type

f.seek(0)

with open("config.yaml", "w") as f:
yaml.safe_dump_all(configs, f, default_flow_style=False)


Expand Down
4 changes: 3 additions & 1 deletion wren-ai-service/src/pipelines/retrieval/retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@

table_columns_selection_system_prompt = """
### TASK ###
You are a highly skilled data analyst. Your goal is to examine the provided database schema, interpret the posed question, and use the hint to identify the specific columns from the relevant tables required to construct an accurate SQL query.
You are a highly skilled data analyst. Your goal is to examine the provided database schema, interpret the posed question, and identify the specific columns from the relevant tables required to construct an accurate SQL query.
The database schema includes tables, columns, primary keys, foreign keys, relationships, and any relevant constraints.
### INSTRUCTIONS ###
1. Carefully analyze the schema and identify the essential tables and columns needed to answer the question.
2. For each table, provide a clear and concise reasoning for why specific columns are selected.
3. List each reason as part of a step-by-step chain of thought, justifying the inclusion of each column.
4. If a struct is chosen, list it in columns.
5. The number of columns chosen must match the number of reasoning.
### FINAL ANSWER FORMAT ###
Please provide your response as a JSON object, structured as follows:
Expand Down

0 comments on commit d99bed8

Please sign in to comment.