You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # AssistantBench Benchmark
  2. This scenario implements the [AssistantBench](https://assistantbench.github.io/) agent benchmark. Before you begin, make sure you have followed the instructions in `../README.md` to prepare your environment. We modify the evaluation code from AssistantBench in [Scripts](Scripts) and retain the license including it here [LICENSE](Scripts/evaluate_utils/LICENSE). Please find the original AssistantBench evaluation code here [https://huggingface.co/spaces/AssistantBench/leaderboard/tree/main/evaluation](https://huggingface.co/spaces/AssistantBench/leaderboard/tree/main/evaluation).
  3. ### Setup Environment Variables for AgBench
  4. Navigate to AssistantBench
  5. ```bash
  6. cd benchmarks/AssistantBench
  7. ```
  8. Create a file called ENV.json with the following (required) contents (If you're using MagenticOne)
  9. ```json
  10. {
  11. "BING_API_KEY": "REPLACE_WITH_YOUR_BING_API_KEY",
  12. "HOMEPAGE": "https://www.bing.com/",
  13. "WEB_SURFER_DEBUG_DIR": "/autogen/debug",
  14. "CHAT_COMPLETION_KWARGS_JSON": "{\"api_version\": \"2024-02-15-preview\", \"azure_endpoint\": \"YOUR_ENDPOINT/\", \"model_capabilities\": {\"function_calling\": true, \"json_output\": true, \"vision\": true}, \"azure_ad_token_provider\": \"DEFAULT\", \"model\": \"gpt-4o-2024-05-13\"}",
  15. "CHAT_COMPLETION_PROVIDER": "azure"
  16. }
  17. ```
  18. You can also use the openai client by replacing the last two entries in the ENV file by:
  19. - `CHAT_COMPLETION_PROVIDER='openai'`
  20. - `CHAT_COMPLETION_KWARGS_JSON` with the following JSON structure:
  21. ```json
  22. {
  23. "api_key": "REPLACE_WITH_YOUR_API",
  24. "model": "gpt-4o-2024-05-13"
  25. }
  26. ```
  27. Now initialize the tasks.
  28. ```bash
  29. python Scripts/init_tasks.py
  30. ```
  31. Note: This will attempt to download AssistantBench from Huggingface, but this requires authentication.
  32. After running the script, you should see the new following folders and files:
  33. ```
  34. .
  35. ./Downloads
  36. ./Downloads/AssistantBench
  37. ./Downloads/AssistantBench/assistant_bench_v1.0_dev.jsonl
  38. ./Downloads/AssistantBench/assistant_bench_v1.0_dev.jsonl
  39. ./Tasks
  40. ./Tasks/assistant_bench_v1.0_dev.jsonl
  41. ./Tasks/assistant_bench_v1.0_dev.jsonl
  42. ```
  43. Then run `Scripts/init_tasks.py` again.
  44. Once the script completes, you should now see a folder in your current directory called `Tasks` that contains one JSONL file per template in `Templates`.
  45. ### Running AssistantBench
  46. Now to run a specific subset of AssistantBench use:
  47. ```bash
  48. agbench run Tasks/assistant_bench_v1.0_dev__MagenticOne.jsonl
  49. ```
  50. You should see the command line print the raw logs that shows the agents in action To see a summary of the results (e.g., task completion rates), in a new terminal run the following:
  51. ```bash
  52. agbench tabulate Results/assistant_bench_v1.0_dev__MagenticOne
  53. ```
  54. ## References
  55. Yoran, Ori, Samuel Joseph Amouyal, Chaitanya Malaviya, Ben Bogin, Ofir Press, and Jonathan Berant. "AssistantBench: Can Web Agents Solve Realistic and Time-Consuming Tasks?." arXiv preprint arXiv:2407.15711 (2024). https://arxiv.org/abs/2407.15711