Skip to content

Commit c5d7b65

Browse files
adjusted prompt to reduce halucinations: nested filter/context calls and putting filter args in quotation marks
1 parent 5d4ff64 commit c5d7b65

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dbally/iql_generator/prompt.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ def __init__(
7676
"It is VERY IMPORTANT not to use methods other than those listed above.\n"
7777
"Finally, if a called function argument value is not directly specified in the query but instead requires "
7878
"some additional execution context, than substitute that argument value with: AskerContext().\n"
79-
'The typical input phrase suggesting that the additional execution context need to be referenced contains words like: "I", "my", "mine", "current", "the" etc..\n'
79+
"The typical input phrase suggesting that the additional execution context need to be referenced \n"
80+
'contains words like: "I", "my", "mine", "current", "the" etc..\n'
8081
'For example: "my position name", "my company valuation", "current day", "the ongoing project".\n'
8182
"In that case, the part of the output will look like this:\n"
8283
"filter4(AskerContext())\n"
84+
"Outside this situation DO NOT combine filters like this:\n"
85+
"filter4(filter2())\n"
86+
"And NEVER quote the filter argument unless you're sure it represents the string/literal datatype, \n"
87+
"Especially do not quote AskerContext() calls like this:\n"
88+
"filter2('AskerContext()')\n"
8389
"""If you DON'T KNOW HOW TO ANSWER DON'T SAY \"\", SAY: `UNSUPPORTED QUERY` INSTEAD! """
8490
"This is CRUCIAL, otherwise the system will crash. "
8591
),

0 commit comments

Comments
 (0)