Skip to content

Commit 902f5ff

Browse files
IQL generating LLM prompt passes BaseCallerContext() as filter argument when it detectes the additional context is required
1 parent 73741d9 commit 902f5ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/dbally/iql_generator/iql_prompt_template.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ def _validate_iql_response(llm_response: str) -> str:
6060
"You MUST use only these methods:\n"
6161
"\n{filters}\n"
6262
"It is VERY IMPORTANT not to use methods other than those listed above."
63+
"If a called function argument value is not directly specified in the query but instead requires knowledge of some additional context, than substitute that argument value by: BaseCallerContext()."
64+
'The typical input phrase referencing some additional context contains the word "my" or similar phrasing, e.g. "my position name", "my company valuation".'
65+
"In that case, the part of the output will look like this:"
66+
"filter4(BaseCallerContext())"
6367
"""If you DON'T KNOW HOW TO ANSWER DON'T SAY \"\", SAY: `UNSUPPORTED QUERY` INSTEAD! """
6468
"This is CRUCIAL, otherwise the system will crash. ",
6569
},
6670
{"role": "user", "content": "{question}"},
67-
),
71+
), # type: ignore # TODO fix it
6872
llm_response_parser=_validate_iql_response,
6973
)

0 commit comments

Comments
 (0)