Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3fe4f87

Browse files
committedAug 7, 2024·
bug fix
1 parent bb7f653 commit 3fe4f87

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
 

‎src/dbally/iql_generator/prompt.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -128,20 +128,24 @@ def __init__(
128128
"role": "system",
129129
"content": (
130130
"Given a question, determine whether the answer requires initial data filtering in order to compute it.\n"
131-
"Filtering is a process in which the entities are reduced to only include the rows that meet "
132-
"certain criteria specified in the question.\n\n"
131+
"Initial data filtering is a process in which the result set is reduced to only include the rows "
132+
"that meet certain criteria specified in the question.\n\n"
133133
"---\n\n"
134134
"Follow the following format.\n\n"
135135
"Question: ${{question}}\n"
136-
"Reasoning: Let's think step by step in order to ${{determine if the answer to "
137-
"the question requires initial data filtering based on its specific features}}. We...\n"
136+
"Hint: ${{hint}}"
137+
"Reasoning: Let's think step by step in order to ${{produce the decision}}. We...\n"
138138
"Decision: indicates whether the answer to the question requires initial data filtering. "
139139
"(Respond with True or False)\n\n"
140140
),
141141
},
142142
{
143143
"role": "user",
144-
"content": ("Question: {question}\n" "Reasoning: Let's think step by step in order to "),
144+
"content": (
145+
"Question: {question}\n"
146+
"Hint: Look for words indicating data specific features.\n"
147+
"Reasoning: Let's think step by step in order to "
148+
),
145149
},
146150
],
147151
response_parser=_decision_iql_response_parser,

‎src/dbally/views/structured.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def ask(
9494
await self.apply_filters(iql)
9595

9696
result = self.execute(dry_run=dry_run)
97-
result.context["iql"] = f"{iql}"
97+
result.context["iql"] = str(iql) if iql else None
9898

9999
return result
100100

0 commit comments

Comments
 (0)
Please sign in to comment.