Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(wren-ai-service): minor updates #721

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading