"""96 hand-written tool-calling tasks with exact ground truth, 6 categories x 16. Written and frozen before any model run (see git history / tasks_sha256 in results.json). All names, addresses and data are fictional. Argument matchers (see scoring.py): literal normalised equality (strings: case + whitespace; numbers: tolerance; arrays: order-insensitive; objects: recursive) {"$any": [...]} any of several accepted answers {"$contains": [...]} free-text string containing all of these (case-insensitive) {"$math": x} arithmetic expression whose value equals x {"$city": "paris"} location string whose first comma-separated part is this city {"$time": "09:15"} clock time; "9:15" and "09:15" both accepted """ TODAY = "Monday 2026-11-02" SYSTEM_PROMPT = ( f"You are a helpful assistant running on the user's laptop. Today is {TODAY}. " "Use a tool only when it is needed to fulfil the request; otherwise answer directly." ) def call(name, allow_extra=(), **args): return {"name": name, "args": args, "allow_extra": list(allow_extra)} def C(*words): return {"$contains": list(words)} def city(c): return {"$city": c} def T(id, cat, prompt, calls, distractors=()): return {"id": id, "category": cat, "prompt": prompt, "expected": calls, "distractors": list(distractors)} TASKS = [ # 1. single obvious call T("single-01", "single", "What's the weather like in Lisbon right now?", [call("get_weather", location=city("lisbon"))]), T("single-02", "single", "Set a timer for 10 minutes.", [call("set_timer", ["label"], duration_seconds=600)]), T("single-03", "single", "Convert 5 kilometers to miles.", [call("convert_units", value=5, from_unit="km", to_unit="mi")]), T("single-04", "single", "Add 'buy oat milk' to my to-do list.", [call("add_todo", title=C("oat milk"))]), T("single-05", "single", "Mark to-do number 42 as done.", [call("complete_todo", todo_id=42)]), T("single-06", "single", "How much is 250 euros in US dollars?", [call("convert_currency", amount=250, from_currency="EUR", to_currency="USD")]), T("single-07", "single", "Calculate 17 * 23 + 5.", [call("evaluate_math", ["precision"], expression={"$math": 396})]), T("single-08", "single", "Show me my calendar events from November 2 to November 6, 2026.", [call("list_calendar_events", date_from="2026-11-02", date_to="2026-11-06")]), T("single-09", "single", "Find my files about the Q3 budget.", [call("search_files", query=C("q3", "budget"))]), T("single-10", "single", "Give me the 5-day forecast for Oslo.", [call("get_forecast", location=city("oslo"), days=5)]), T("single-11", "single", "Send an email to maya@example.com with the subject 'Lunch' saying: Are we still on for Thursday?", [call("send_email", to=["maya@example.com"], subject="Lunch", body=C("still on for thursday"))]), T("single-12", "single", "Put a 'Dentist' appointment in my calendar on 2026-11-12 at 09:30 for 45 minutes.", [call("create_calendar_event", title=C("dentist"), date="2026-11-12", start_time={"$time": "09:30"}, duration_minutes=45)]), T("single-13", "single", "Start a 90-second timer labelled 'tea'.", [call("set_timer", duration_seconds=90, label=C("tea"))]), T("single-14", "single", "What is the temperature in Nairobi at the moment?", [call("get_weather", location=city("nairobi"))]), T("single-15", "single", "Convert 3 gallons to liters.", [call("convert_units", value=3, from_unit="gal", to_unit="l")]), T("single-16", "single", "Evaluate (12.5 + 7.5) / 4.", [call("evaluate_math", ["precision"], expression={"$math": 5})]), # 2. choose the right tool among similar distractors (distractors are forced into the menu) T("distract-01", "distractor", "Will it rain in Dublin over the next 3 days?", [call("get_forecast", location=city("dublin"), days=3)], ["get_weather"]), T("distract-02", "distractor", "Is it windy in Dublin right now?", [call("get_weather", location=city("dublin"))], ["get_forecast"]), T("distract-03", "distractor", "Convert 100 pounds sterling to euros.", [call("convert_currency", amount=100, from_currency="GBP", to_currency="EUR")], ["convert_units"]), T("distract-04", "distractor", "Convert 100 pounds to kilograms.", [call("convert_units", value=100, from_unit="lb", to_unit="kg")], ["convert_currency"]), T("distract-05", "distractor", "I finished to-do item 7, tick it off.", [call("complete_todo", todo_id=7)], ["add_todo"]), T("distract-06", "distractor", "I need to call the plumber at some point - put it on my to-do list.", [call("add_todo", title=C("plumber"))], ["complete_todo", "set_timer", "create_calendar_event"]), T("distract-07", "distractor", "What's on my calendar on November 10, 2026?", [call("list_calendar_events", date_from="2026-11-10", date_to="2026-11-10")], ["create_calendar_event"]), T("distract-08", "distractor", "Block 2026-11-10 from 14:00 for 30 minutes as 'Focus time'.", [call("create_calendar_event", title=C("focus"), date="2026-11-10", start_time={"$time": "14:00"}, duration_minutes=30)], ["list_calendar_events", "set_timer"]), T("distract-09", "distractor", "Ping me in 25 minutes when the laundry is done.", [call("set_timer", ["label"], duration_seconds=1500)], ["create_calendar_event", "add_todo"]), T("distract-10", "distractor", "What's 18% of 2450?", [call("evaluate_math", ["precision"], expression={"$math": 441})], ["convert_units", "convert_currency"]), T("distract-11", "distractor", "How many US dollars is 5000 yen?", [call("convert_currency", amount=5000, from_currency="JPY", to_currency="USD")], ["convert_units", "evaluate_math"]), T("distract-12", "distractor", "How hot will it get in Phoenix this week? Give me 7 days in Fahrenheit.", [call("get_forecast", location=city("phoenix"), days=7, units="imperial")], ["get_weather"]), T("distract-13", "distractor", "Email the team at team@example.com that the demo moved to Friday. Subject: 'Demo moved'.", [call("send_email", to=["team@example.com"], subject="Demo moved", body=C("friday"))], ["add_todo", "create_calendar_event"]), T("distract-14", "distractor", "Did I put anything on my work calendar for 2026-11-04?", [call("list_calendar_events", date_from="2026-11-04", date_to="2026-11-04", calendar="work")], ["create_calendar_event"]), T("distract-15", "distractor", "What's the current temperature in Toronto in Fahrenheit?", [call("get_weather", location=city("toronto"), units="imperial")], ["get_forecast", "convert_units"]), T("distract-16", "distractor", "How many feet is 1200 meters?", [call("convert_units", value=1200, from_unit="m", to_unit="ft")], ["convert_currency", "evaluate_math"]), # 3. enum- or type-sensitive arguments T("enum-01", "enum_type", "Add a high-priority to-do: renew passport.", [call("add_todo", title=C("passport"), priority="high")]), T("enum-02", "enum_type", "Convert 72 Fahrenheit to Celsius.", [call("convert_units", value=72, from_unit="f", to_unit="c")]), T("enum-03", "enum_type", "Forecast for Chicago for the next two days, in imperial units.", [call("get_forecast", location=city("chicago"), days=2, units="imperial")]), T("enum-04", "enum_type", "Create a public event 'Team BBQ' on 2026-11-14 at 12:00 for 3 hours.", [call("create_calendar_event", title=C("bbq"), date="2026-11-14", start_time={"$time": "12:00"}, duration_minutes=180, visibility="public")]), T("enum-05", "enum_type", "List my personal calendar events for next week, Monday 2026-11-09 to Sunday 2026-11-15.", [call("list_calendar_events", date_from="2026-11-09", date_to="2026-11-15", calendar="personal")]), T("enum-06", "enum_type", "Set a timer for one and a half hours.", [call("set_timer", ["label"], duration_seconds=5400)]), T("enum-07", "enum_type", "Convert 1500 milliliters to liters.", [call("convert_units", value=1500, from_unit="ml", to_unit="l")]), T("enum-08", "enum_type", "Convert 2.5 kilograms to ounces.", [call("convert_units", value=2.5, from_unit="kg", to_unit="oz")]), T("enum-09", "enum_type", "Low-priority to-do: clean the garage, due 2026-11-21.", [call("add_todo", title=C("garage"), priority="low", due_date="2026-11-21")]), T("enum-10", "enum_type", "What's 1 divided by 3, to 4 decimal places?", [call("evaluate_math", expression={"$math": 1 / 3}, precision=4)]), T("enum-11", "enum_type", "Convert 99.99 Swiss francs to Canadian dollars.", [call("convert_currency", amount=99.99, from_currency="CHF", to_currency="CAD")]), T("enum-12", "enum_type", "Show me only the 3 most relevant files matching 'onboarding checklist'.", [call("search_files", query=C("onboarding checklist"), max_results=3)]), T("enum-13", "enum_type", "Complete to-do #105.", [call("complete_todo", todo_id=105)]), T("enum-14", "enum_type", "Add an event 'Standup' on 2026-11-03 at 9:15 for 15 minutes.", [call("create_calendar_event", title=C("standup"), date="2026-11-03", start_time={"$time": "09:15"}, duration_minutes=15)]), T("enum-15", "enum_type", "Convert 10 inches to centimeters.", [call("convert_units", value=10, from_unit="in", to_unit="cm")]), T("enum-16", "enum_type", "How many Indian rupees do I get for 40 Australian dollars?", [call("convert_currency", amount=40, from_currency="AUD", to_currency="INR")]), # 4. nested-object or array arguments T("nested-01", "nested_array", "Schedule 'Design review' on 2026-11-05 at 15:00 for 60 minutes with ana@example.com and raj@example.com.", [call("create_calendar_event", title=C("design review"), date="2026-11-05", start_time={"$time": "15:00"}, duration_minutes=60, attendees=["ana@example.com", "raj@example.com"])]), T("nested-02", "nested_array", "Create 'Board meeting' on 2026-11-19 at 10:00 for 90 minutes, with a popup reminder 15 minutes before.", [call("create_calendar_event", title=C("board meeting"), date="2026-11-19", start_time={"$time": "10:00"}, duration_minutes=90, reminder={"minutes_before": 15, "method": "popup"})]), T("nested-03", "nested_array", "Search my files for 'invoice', only PDFs and xlsx spreadsheets.", [call("search_files", query=C("invoice"), filters={"file_types": ["pdf", "xlsx"]})]), T("nested-04", "nested_array", "Find files mentioning 'roadmap' in the /Work/Planning folder, modified after 2026-10-01.", [call("search_files", query=C("roadmap"), filters={"folder": "/Work/Planning", "modified_after": "2026-10-01"})]), T("nested-05", "nested_array", "Email ops@example.com and cto@example.com, cc legal@example.com, subject 'Incident report', " "body 'The outage is resolved.'", [call("send_email", to=["ops@example.com", "cto@example.com"], cc=["legal@example.com"], subject="Incident report", body=C("outage is resolved"))]), T("nested-06", "nested_array", "Add a to-do 'Prepare slides' tagged work and urgent.", [call("add_todo", title=C("prepare slides"), tags=["work", "urgent"])]), T("nested-07", "nested_array", "Add 'Book flights' to my to-dos, due 2026-12-01, high priority, tags travel and family.", [call("add_todo", title=C("book flights"), due_date="2026-12-01", priority="high", tags=["travel", "family"])]), T("nested-08", "nested_array", "Set up 'Sprint planning' on 2026-11-09 at 10:00 for 2 hours, invite dev1@example.com, dev2@example.com " "and dev3@example.com, and send an email reminder 1 hour before.", [call("create_calendar_event", title=C("sprint planning"), date="2026-11-09", start_time={"$time": "10:00"}, duration_minutes=120, attendees=["dev1@example.com", "dev2@example.com", "dev3@example.com"], reminder={"minutes_before": 60, "method": "email"})]), T("nested-09", "nested_array", "Search for 'holiday photos' among png and jpg files only.", [call("search_files", query=C("holiday photos"), filters={"file_types": ["png", "jpg"]})]), T("nested-10", "nested_array", "Send the weekly report to alice@example.com, bob@example.com and carol@example.com. " "Subject: 'Weekly report'. Body: 'Attached is this week's report.'", [call("send_email", to=["alice@example.com", "bob@example.com", "carol@example.com"], subject="Weekly report", body=C("this week's report"))]), T("nested-11", "nested_array", "Find csv or txt files with 'sensor log' in the /Lab folder.", [call("search_files", query=C("sensor log"), filters={"file_types": ["csv", "txt"], "folder": "/Lab"})]), T("nested-12", "nested_array", "Create 'Lunch with Sam' on 2026-11-06 at 12:30 for 60 minutes, invite sam@example.com, " "popup reminder 10 minutes before.", [call("create_calendar_event", title=C("lunch with sam"), date="2026-11-06", start_time={"$time": "12:30"}, duration_minutes=60, attendees=["sam@example.com"], reminder={"minutes_before": 10, "method": "popup"})]), T("nested-13", "nested_array", "To-do: 'Submit tax forms', tagged finance, due 2026-11-30.", [call("add_todo", title=C("submit tax forms"), tags=["finance"], due_date="2026-11-30")]), T("nested-14", "nested_array", "Email hr@example.com and cc my manager boss@example.com. Subject 'Vacation request', " "body: I'd like to take December 21-24 off.", [call("send_email", to=["hr@example.com"], cc=["boss@example.com"], subject="Vacation request", body=C("december 21"))]), T("nested-15", "nested_array", "Search for 'contract' in docx and pdf files modified after 2026-09-15, at most 5 results.", [call("search_files", query=C("contract"), filters={"file_types": ["docx", "pdf"], "modified_after": "2026-09-15"}, max_results=5)]), T("nested-16", "nested_array", "Create a private event 'Therapy' on 2026-11-11 at 17:00 for 50 minutes with an email reminder " "30 minutes before.", [call("create_calendar_event", title=C("therapy"), date="2026-11-11", start_time={"$time": "17:00"}, duration_minutes=50, reminder={"minutes_before": 30, "method": "email"})]), # 5. two independent calls (order-insensitive) T("parallel-01", "parallel", "What's the weather right now in Paris and in Rome?", [call("get_weather", location=city("paris")), call("get_weather", location=city("rome"))]), T("parallel-02", "parallel", "Convert 10 miles to km, and 50 USD to EUR.", [call("convert_units", value=10, from_unit="mi", to_unit="km"), call("convert_currency", amount=50, from_currency="USD", to_currency="EUR")]), T("parallel-03", "parallel", "Add 'call mom' to my to-dos and set a 5-minute timer.", [call("add_todo", title=C("call mom")), call("set_timer", ["label"], duration_seconds=300)]), T("parallel-04", "parallel", "Mark to-dos 12 and 15 as done.", [call("complete_todo", todo_id=12), call("complete_todo", todo_id=15)]), T("parallel-05", "parallel", "Get the 3-day forecast for Berlin and the current weather in Madrid.", [call("get_forecast", location=city("berlin"), days=3), call("get_weather", location=city("madrid"))]), T("parallel-06", "parallel", "Calculate 2^10, and convert 30 Celsius to Fahrenheit.", [call("evaluate_math", ["precision"], expression={"$math": 1024}), call("convert_units", value=30, from_unit="c", to_unit="f")]), T("parallel-07", "parallel", "Show my calendar for 2026-11-03 and find my files about 'quarterly review'.", [call("list_calendar_events", date_from="2026-11-03", date_to="2026-11-03"), call("search_files", query=C("quarterly review"))]), T("parallel-08", "parallel", "Email dan@example.com with subject 'Hi' and body 'Running late', and add 'reschedule dentist' to my to-dos.", [call("send_email", to=["dan@example.com"], subject="Hi", body=C("running late")), call("add_todo", title=C("reschedule dentist"))]), T("parallel-09", "parallel", "Set a 20-minute timer labelled 'pasta' and a 45-minute timer labelled 'bread'.", [call("set_timer", duration_seconds=1200, label=C("pasta")), call("set_timer", duration_seconds=2700, label=C("bread"))]), T("parallel-10", "parallel", "How much is 75 GBP in JPY, and 75 GBP in INR?", [call("convert_currency", amount=75, from_currency="GBP", to_currency="JPY"), call("convert_currency", amount=75, from_currency="GBP", to_currency="INR")]), T("parallel-11", "parallel", "Current weather in Tokyo in imperial units, and the 2-day forecast for Osaka in metric.", [call("get_weather", location=city("tokyo"), units="imperial"), call("get_forecast", location=city("osaka"), days=2)]), T("parallel-12", "parallel", "Create 'Yoga' on 2026-11-04 at 07:00 for 60 minutes and another 'Yoga' on 2026-11-06 at 07:00 for 60 minutes.", [call("create_calendar_event", title=C("yoga"), date="2026-11-04", start_time={"$time": "07:00"}, duration_minutes=60), call("create_calendar_event", title=C("yoga"), date="2026-11-06", start_time={"$time": "07:00"}, duration_minutes=60)]), T("parallel-13", "parallel", "Convert 5 feet to centimeters and 150 pounds to kilograms.", [call("convert_units", value=5, from_unit="ft", to_unit="cm"), call("convert_units", value=150, from_unit="lb", to_unit="kg")]), T("parallel-14", "parallel", "Search my files for 'passport scan' and add a high-priority to-do 'renew passport'.", [call("search_files", query=C("passport scan")), call("add_todo", title=C("renew passport"), priority="high")]), T("parallel-15", "parallel", "What's (3+4)*5, and what's 144/12?", [call("evaluate_math", ["precision"], expression={"$math": 35}), call("evaluate_math", ["precision"], expression={"$math": 12})]), T("parallel-16", "parallel", "List my work events from 2026-11-02 to 2026-11-06 and my personal events from 2026-11-07 to 2026-11-08.", [call("list_calendar_events", date_from="2026-11-02", date_to="2026-11-06", calendar="work"), call("list_calendar_events", date_from="2026-11-07", date_to="2026-11-08", calendar="personal")]), # 6. no tool needed: the model should answer directly T("notool-01", "no_tool", "What's the capital of Australia?", []), T("notool-02", "no_tool", "Write a haiku about autumn leaves.", []), T("notool-03", "no_tool", "Thanks, that's all for now!", []), T("notool-04", "no_tool", "Explain in one sentence what a hash table is.", []), T("notool-05", "no_tool", "Who wrote 'Pride and Prejudice'?", []), T("notool-06", "no_tool", "Can you suggest three names for a pet goldfish?", []), T("notool-07", "no_tool", "What does the acronym HTTP stand for?", []), T("notool-08", "no_tool", "In one paragraph, what's the difference between weather and climate?", []), T("notool-09", "no_tool", "Book me a table for two at an Italian restaurant tonight.", []), T("notool-10", "no_tool", "Is a tomato a fruit or a vegetable?", []), T("notool-11", "no_tool", "Tell me a short joke about programmers.", []), T("notool-12", "no_tool", "What year did Apollo 11 land on the Moon?", []), T("notool-13", "no_tool", "Order me a large pepperoni pizza.", []), T("notool-14", "no_tool", "Summarise the plot of Romeo and Juliet in two sentences.", []), T("notool-15", "no_tool", "What's the boiling point of water at sea level in Celsius?", []), T("notool-16", "no_tool", "Hi! What kinds of things can you help me with?", []), ] # Untimed warm-up prompts (not scored, not part of the 96). WARMUP = [ T("warmup-1", "warmup", "Convert 12 liters to gallons.", [call("convert_units", value=12, from_unit="l", to_unit="gal")]), T("warmup-2", "warmup", "What's the weather in Cairo right now?", [call("get_weather", location=city("cairo"))]), T("warmup-3", "warmup", "Name a primary colour.", []), ] CATEGORIES = ["single", "distractor", "enum_type", "nested_array", "parallel", "no_tool"]