Skip to content

Commit 4226309

Browse files
committed
Fix query rewriting extraction
1 parent 5031c2f commit 4226309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fastapi_app/query_rewriter.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def extract_search_arguments(chat_completion: ChatCompletion):
6868
if function.name == "search_database":
6969
arg = json.loads(function.arguments)
7070
search_query = arg.get("search_query")
71-
if "price_filter" in arg:
71+
if "price_filter" in arg and arg["price_filter"]:
7272
price_filter = arg["price_filter"]
7373
filters.append(
7474
{
@@ -77,7 +77,7 @@ def extract_search_arguments(chat_completion: ChatCompletion):
7777
"value": price_filter["value"],
7878
}
7979
)
80-
if "brand_filter" in arg:
80+
if "brand_filter" in arg and arg["brand_filter"]:
8181
brand_filter = arg["brand_filter"]
8282
filters.append(
8383
{

0 commit comments

Comments
 (0)