Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ class BasicAgent:
|
|
86 |
is_food_tool = FunctionTool.from_defaults(
|
87 |
name="is_food",
|
88 |
fn=is_food,
|
89 |
-
description="Takes a list of
|
90 |
)
|
91 |
|
92 |
|
@@ -496,9 +496,24 @@ def create_mock_questions():
|
|
496 |
"question": "What is the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists?",
|
497 |
"Level": "1",
|
498 |
"file_name": ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
499 |
}
|
500 |
-
|
501 |
-
|
|
|
|
|
|
|
|
|
|
|
502 |
'task_id': '99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3',
|
503 |
'question': 'Hi, I\'m making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I\'m not sure about the filling. I got the recipe from my friend Aditi, but she left it as a voice memo and the speaker on my phone is buzzing so I can\'t quite make out what she\'s saying. Could you please listen to the recipe and list all of the ingredients that my friend described? I only want the ingredients for the filling, as I have everything I need to make my favorite pie crust. I\'ve attached the recipe as Strawberry pie.mp3.\n\nIn your response, please only list the ingredients, not any measurements. So if the recipe calls for "a pinch of salt" or "two cups of ripe strawberries" the ingredients on the list would be "salt" and "ripe strawberries".\n\nPlease format your response as a comma separated list of ingredients. Also, please alphabetize the ingredients.',
|
504 |
'Level': '1',
|
@@ -533,25 +548,21 @@ def create_mock_questions():
|
|
533 |
"question":".rewsna eht sa \"tfel\" drow eht fo etisoppo eht etirw ,ecnetnes siht dnatsrednu uoy fI",
|
534 |
"Level":"1",
|
535 |
"file_name":""
|
536 |
-
}
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
'''
|
542 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
|
544 |
-
|
545 |
-
{
|
546 |
-
"task_id":"7bd855d8-463d-4ed5-93ca-5fe35145f733",
|
547 |
-
"question":"The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.",
|
548 |
-
"Level":"1",
|
549 |
-
"file_name":"7bd855d8-463d-4ed5-93ca-5fe35145f733.xlsx"
|
550 |
-
}
|
551 |
]
|
552 |
|
553 |
-
|
554 |
-
# 1. Rimuovi dalla serviceList tutte le domande i cui task_id sono in blackList
|
555 |
initial_len = len(serviceList)
|
556 |
serviceList = [q for q in serviceList if q["task_id"] not in blackList]
|
557 |
removed_blacklisted = initial_len - len(serviceList)
|
|
|
86 |
is_food_tool = FunctionTool.from_defaults(
|
87 |
name="is_food",
|
88 |
fn=is_food,
|
89 |
+
description="Takes a list of item names (such as menu categories) and returns a string tagging each item as either food or not. The result is a comma-separated list like 'burgers: True, soda: False'."
|
90 |
)
|
91 |
|
92 |
|
|
|
496 |
"question": "What is the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists?",
|
497 |
"Level": "1",
|
498 |
"file_name": ""
|
499 |
+
}
|
500 |
+
'''
|
501 |
+
|
502 |
+
|
503 |
+
return [
|
504 |
+
{
|
505 |
+
"task_id":"7bd855d8-463d-4ed5-93ca-5fe35145f733",
|
506 |
+
"question":"The attached Excel file contains the sales of menu items for a local fast-food chain. What were the total sales that the chain made from food (not including drinks)? Express your answer in USD with two decimal places.",
|
507 |
+
"Level":"1",
|
508 |
+
"file_name":"7bd855d8-463d-4ed5-93ca-5fe35145f733.xlsx"
|
509 |
}
|
510 |
+
]
|
511 |
+
|
512 |
+
def process_questions(serviceList, whiteList, blackList):
|
513 |
+
# 1. Rimuovi dalla serviceList tutte le domande i cui task_id sono in blackList
|
514 |
+
|
515 |
+
whiteList = [
|
516 |
+
{
|
517 |
'task_id': '99c9cc74-fdc8-46c6-8f8d-3ce2d3bfeea3',
|
518 |
'question': 'Hi, I\'m making a pie but I could use some help with my shopping list. I have everything I need for the crust, but I\'m not sure about the filling. I got the recipe from my friend Aditi, but she left it as a voice memo and the speaker on my phone is buzzing so I can\'t quite make out what she\'s saying. Could you please listen to the recipe and list all of the ingredients that my friend described? I only want the ingredients for the filling, as I have everything I need to make my favorite pie crust. I\'ve attached the recipe as Strawberry pie.mp3.\n\nIn your response, please only list the ingredients, not any measurements. So if the recipe calls for "a pinch of salt" or "two cups of ripe strawberries" the ingredients on the list would be "salt" and "ripe strawberries".\n\nPlease format your response as a comma separated list of ingredients. Also, please alphabetize the ingredients.',
|
519 |
'Level': '1',
|
|
|
548 |
"question":".rewsna eht sa \"tfel\" drow eht fo etisoppo eht etirw ,ecnetnes siht dnatsrednu uoy fI",
|
549 |
"Level":"1",
|
550 |
"file_name":""
|
551 |
+
}
|
552 |
+
]
|
|
|
|
|
|
|
|
|
553 |
|
554 |
+
blackList = [
|
555 |
+
{
|
556 |
+
"task_id":"cca530fc-4052-43b2-b130-b30968d8aa44",
|
557 |
+
"question":"Review the chess position provided in the image. It is black's turn. Provide the correct next move for black which guarantees a win. Please provide your response in algebraic notation.",
|
558 |
+
"Level":"1",
|
559 |
+
"file_name":"cca530fc-4052-43b2-b130-b30968d8aa44.png"
|
560 |
+
},
|
561 |
|
562 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
563 |
]
|
564 |
|
565 |
+
|
|
|
566 |
initial_len = len(serviceList)
|
567 |
serviceList = [q for q in serviceList if q["task_id"] not in blackList]
|
568 |
removed_blacklisted = initial_len - len(serviceList)
|