@@ -22,11 +22,11 @@ def build_search_function() -> list[ChatCompletionToolParam]:
22
22
},
23
23
"price_level_filter" : {
24
24
"type" : "object" ,
25
- "description" : "Filter search results to a certain price level (from 1 $ to 4 $$$$, with 4 being most costly)" ,
25
+ "description" : "Filter search results to a certain price level (from 1 $ to 4 $$$$, with 4 being most costly)" , # noqa: E501
26
26
"properties" : {
27
27
"comparison_operator" : {
28
28
"type" : "string" ,
29
- "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa
29
+ "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa: E501
30
30
},
31
31
"value" : {
32
32
"type" : "number" ,
@@ -36,11 +36,11 @@ def build_search_function() -> list[ChatCompletionToolParam]:
36
36
},
37
37
"rating_filter" : {
38
38
"type" : "object" ,
39
- "description" : "Filter search results based on ratings of restaurant (from 1 to 5 stars, with 5 the best)" ,
39
+ "description" : "Filter search results based on ratings of restaurant (from 1 to 5 stars, with 5 the best)" , # noqa: E501
40
40
"properties" : {
41
41
"comparison_operator" : {
42
42
"type" : "string" ,
43
- "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" ,
43
+ "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa: E501
44
44
},
45
45
"value" : {
46
46
"type" : "string" ,
@@ -69,7 +69,11 @@ def extract_search_arguments(original_user_query: str, chat_completion: ChatComp
69
69
arg = json .loads (function .arguments )
70
70
# Even though its required, search_query is not always specified
71
71
search_query = arg .get ("search_query" , original_user_query )
72
- if "price_level_filter" in arg and arg ["price_level_filter" ] and isinstance (arg ["price_level_filter" ], dict ):
72
+ if (
73
+ "price_level_filter" in arg
74
+ and arg ["price_level_filter" ]
75
+ and isinstance (arg ["price_level_filter" ], dict )
76
+ ):
73
77
price_level_filter = arg ["price_level_filter" ]
74
78
filters .append (
75
79
{
0 commit comments