@@ -22,11 +22,11 @@ def build_search_function() -> list[ChatCompletionToolParam]:
2222 },
2323 "price_level_filter" : {
2424 "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
2626 "properties" : {
2727 "comparison_operator" : {
2828 "type" : "string" ,
29- "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa
29+ "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa: E501
3030 },
3131 "value" : {
3232 "type" : "number" ,
@@ -36,11 +36,11 @@ def build_search_function() -> list[ChatCompletionToolParam]:
3636 },
3737 "rating_filter" : {
3838 "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
4040 "properties" : {
4141 "comparison_operator" : {
4242 "type" : "string" ,
43- "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" ,
43+ "description" : "Operator to compare the column value, either '>', '<', '>=', '<=', '='" , # noqa: E501
4444 },
4545 "value" : {
4646 "type" : "string" ,
@@ -69,7 +69,11 @@ def extract_search_arguments(original_user_query: str, chat_completion: ChatComp
6969 arg = json .loads (function .arguments )
7070 # Even though its required, search_query is not always specified
7171 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+ ):
7377 price_level_filter = arg ["price_level_filter" ]
7478 filters .append (
7579 {
0 commit comments