ag2 0.4b1__py3-none-any.whl → 0.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ag2 might be problematic. Click here for more details.

Files changed (78) hide show
  1. {ag2-0.4b1.dist-info → ag2-0.4.1.dist-info}/METADATA +13 -9
  2. ag2-0.4.1.dist-info/RECORD +158 -0
  3. autogen/agentchat/contrib/agent_builder.py +1 -0
  4. autogen/agentchat/contrib/agent_eval/agent_eval.py +107 -0
  5. autogen/agentchat/contrib/agent_eval/criterion.py +47 -0
  6. autogen/agentchat/contrib/agent_eval/critic_agent.py +47 -0
  7. autogen/agentchat/contrib/agent_eval/quantifier_agent.py +42 -0
  8. autogen/agentchat/contrib/agent_eval/subcritic_agent.py +48 -0
  9. autogen/agentchat/contrib/agent_eval/task.py +43 -0
  10. autogen/agentchat/contrib/captainagent/tools/__init__.py +0 -0
  11. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py +41 -0
  12. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py +29 -0
  13. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py +29 -0
  14. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py +29 -0
  15. autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py +22 -0
  16. autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py +31 -0
  17. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py +26 -0
  18. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py +55 -0
  19. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py +54 -0
  20. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py +39 -0
  21. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py +22 -0
  22. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py +35 -0
  23. autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py +61 -0
  24. autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py +62 -0
  25. autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py +48 -0
  26. autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py +34 -0
  27. autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py +22 -0
  28. autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py +36 -0
  29. autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py +22 -0
  30. autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py +19 -0
  31. autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py +29 -0
  32. autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py +32 -0
  33. autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py +17 -0
  34. autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py +26 -0
  35. autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py +24 -0
  36. autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py +28 -0
  37. autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py +29 -0
  38. autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py +35 -0
  39. autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py +40 -0
  40. autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py +23 -0
  41. autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py +37 -0
  42. autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py +16 -0
  43. autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py +16 -0
  44. autogen/agentchat/contrib/captainagent/tools/requirements.txt +10 -0
  45. autogen/agentchat/contrib/captainagent/tools/tool_description.tsv +34 -0
  46. autogen/agentchat/contrib/captainagent.py +3 -0
  47. autogen/agentchat/contrib/graph_rag/document.py +6 -0
  48. autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py +55 -20
  49. autogen/agentchat/contrib/graph_rag/falkor_graph_rag_capability.py +81 -0
  50. autogen/agentchat/contrib/graph_rag/graph_query_engine.py +7 -1
  51. autogen/agentchat/contrib/graph_rag/graph_rag_capability.py +12 -4
  52. autogen/agentchat/contrib/retrieve_user_proxy_agent.py +7 -3
  53. autogen/agentchat/contrib/swarm_agent.py +69 -20
  54. autogen/agentchat/contrib/tool_retriever.py +6 -0
  55. autogen/coding/base.py +2 -2
  56. autogen/coding/docker_commandline_code_executor.py +2 -2
  57. autogen/coding/factory.py +2 -2
  58. autogen/coding/func_with_reqs.py +2 -2
  59. autogen/coding/jupyter/base.py +2 -2
  60. autogen/coding/jupyter/docker_jupyter_server.py +2 -2
  61. autogen/coding/jupyter/embedded_ipython_code_executor.py +2 -2
  62. autogen/coding/jupyter/jupyter_client.py +2 -2
  63. autogen/coding/jupyter/jupyter_code_executor.py +2 -2
  64. autogen/coding/jupyter/local_jupyter_server.py +2 -2
  65. autogen/coding/local_commandline_code_executor.py +2 -2
  66. autogen/coding/markdown_code_extractor.py +2 -2
  67. autogen/coding/utils.py +2 -2
  68. autogen/oai/bedrock.py +6 -0
  69. autogen/oai/cerebras.py +6 -0
  70. autogen/oai/ollama.py +6 -0
  71. autogen/oai/openai_utils.py +1 -0
  72. autogen/token_count_utils.py +2 -0
  73. autogen/version.py +1 -1
  74. ag2-0.4b1.dist-info/RECORD +0 -115
  75. {ag2-0.4b1.dist-info → ag2-0.4.1.dist-info}/LICENSE +0 -0
  76. {ag2-0.4b1.dist-info → ag2-0.4.1.dist-info}/NOTICE.md +0 -0
  77. {ag2-0.4b1.dist-info → ag2-0.4.1.dist-info}/WHEEL +0 -0
  78. {ag2-0.4b1.dist-info → ag2-0.4.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ag2
3
- Version: 0.4b1
3
+ Version: 0.4.1
4
4
  Summary: A programming framework for agentic AI
5
5
  Home-page: https://github.com/ag2ai/ag2
6
6
  Author: Chi Wang & Qingyun Wu
@@ -30,7 +30,7 @@ Requires-Dist: anthropic (>=0.23.1) ; extra == 'anthropic'
30
30
  Provides-Extra: autobuild
31
31
  Requires-Dist: chromadb ; extra == 'autobuild'
32
32
  Requires-Dist: huggingface-hub ; extra == 'autobuild'
33
- Requires-Dist: pysqlite3 ; extra == 'autobuild'
33
+ Requires-Dist: pysqlite3-binary ; extra == 'autobuild'
34
34
  Requires-Dist: sentence-transformers ; extra == 'autobuild'
35
35
  Provides-Extra: bedrock
36
36
  Requires-Dist: boto3 (>=1.34.149) ; extra == 'bedrock'
@@ -39,7 +39,8 @@ Requires-Dist: flaml[blendsearch] ; extra == 'blendsearch'
39
39
  Provides-Extra: captainagent
40
40
  Requires-Dist: chromadb ; extra == 'captainagent'
41
41
  Requires-Dist: huggingface-hub ; extra == 'captainagent'
42
- Requires-Dist: pysqlite3 ; extra == 'captainagent'
42
+ Requires-Dist: pandas ; extra == 'captainagent'
43
+ Requires-Dist: pysqlite3-binary ; extra == 'captainagent'
43
44
  Requires-Dist: sentence-transformers ; extra == 'captainagent'
44
45
  Provides-Extra: cerebras
45
46
  Requires-Dist: cerebras-cloud-sdk (>=1.0.0) ; extra == 'cerebras'
@@ -57,7 +58,7 @@ Provides-Extra: graph
57
58
  Requires-Dist: matplotlib ; extra == 'graph'
58
59
  Requires-Dist: networkx ; extra == 'graph'
59
60
  Provides-Extra: graph_rag_falkor_db
60
- Requires-Dist: graphrag-sdk ; extra == 'graph_rag_falkor_db'
61
+ Requires-Dist: graphrag-sdk (==0.3.3) ; extra == 'graph_rag_falkor_db'
61
62
  Provides-Extra: groq
62
63
  Requires-Dist: groq (>=0.9.0) ; extra == 'groq'
63
64
  Provides-Extra: jupyter-executor
@@ -150,6 +151,7 @@ Requires-Dist: pdfminer.six ; extra == 'websurfer'
150
151
 
151
152
  <a name="readme-top"></a>
152
153
 
154
+ ![Pypi Downloads](https://img.shields.io/pypi/dm/pyautogen?label=PyPI%20downloads)
153
155
  [![PyPI version](https://badge.fury.io/py/autogen.svg)](https://badge.fury.io/py/autogen)
154
156
  [![Build](https://github.com/ag2ai/ag2/actions/workflows/python-package.yml/badge.svg)](https://github.com/ag2ai/ag2/actions/workflows/python-package.yml)
155
157
  ![Python Version](https://img.shields.io/badge/3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)
@@ -166,9 +168,12 @@ Requires-Dist: pdfminer.six ; extra == 'websurfer'
166
168
  <br>
167
169
  </p> -->
168
170
 
169
- > [!IMPORTANT]
171
+ > **:tada: IMPORTANT**
170
172
  >
171
- > :fire: :tada: Nov 11, 2024: We are evolving AutoGen into AG2! A new organization [ag2ai](https://github.com/ag2ai) is created to host the development of AG2 and related projects with open governance. We invite collaborators from all organizations and individuals to join the development.
173
+ > :fire: :tada: **Nov 11, 2024:** We are evolving AutoGen into **AG2**!
174
+ > A new organization [AG2ai](https://github.com/ag2ai) is created to host the development of AG2 and related projects with open governance. Check [AG2's new look](https://ag2.ai/).
175
+ >
176
+ > We invite collaborators from all organizations and individuals to join the development.
172
177
 
173
178
 
174
179
  :fire: :tada: AG2 is available via `ag2` (or its alias `autogen` or `pyautogen`) on PyPI! Starting with version 0.3.2, you can now install AG2 using:
@@ -241,8 +246,7 @@ AG2 (formerly AutoGen) is an open-source programming framework for building AI a
241
246
  The project is currently maintained by a [dynamic group of volunteers](MAINTAINERS.md) from several organizations. Contact project administrators Chi Wang and Qingyun Wu via [support@ag2.ai](mailto:support@ag2.ai) if you are interested in becoming a maintainer.
242
247
 
243
248
 
244
- ![AutoGen Overview](./website/static/img/autogen_agentchat.png)
245
-
249
+ ![AutoGen Overview](https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/autogen_agentchat.png)
246
250
 
247
251
 
248
252
  <p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
@@ -342,7 +346,7 @@ python test/twoagent.py
342
346
  After the repo is cloned.
343
347
  The figure below shows an example conversation flow with AG2.
344
348
 
345
- ![Agent Chat Example](./website/static/img/chat_example.png)
349
+ ![Agent Chat Example](https://media.githubusercontent.com/media/ag2ai/ag2/refs/heads/main/website/static/img/chat_example.png)
346
350
 
347
351
 
348
352
  Alternatively, the [sample code](https://github.com/ag2ai/build-with-ag2/blob/main/samples/simple_chat.py) here allows a user to chat with an AG2 agent in ChatGPT style.
@@ -0,0 +1,158 @@
1
+ autogen/__init__.py,sha256=eNsTdCkF0qnFdptTUXK9T7Vx7SbUVjvIt3ryRdsyCL4,491
2
+ autogen/_pydantic.py,sha256=HRc_pCb9puuh4uOyVzeJPNm__XSYbLQ26Gnc5xXgQU8,3409
3
+ autogen/browser_utils.py,sha256=DiDUvsiSkTFItU_tOqTQAbeg3E8Br9SX2cd2P-zOipM,11939
4
+ autogen/code_utils.py,sha256=NS2QrVxpVQo2e5QNndXy6mRmtfv_zHs4ZHl-MMib4z4,29835
5
+ autogen/exception_utils.py,sha256=WEdeVlc_otHXgWQZ-lqaHdezXdrl3Q4M-qfpBv4eiE0,1581
6
+ autogen/formatting_utils.py,sha256=lhNmim0G6Vmlrz6D-ra6u0YRt7wP98nSGubRYJ3717Q,1913
7
+ autogen/function_utils.py,sha256=6wTb2LxTzGveMk360JerU9l7hA497alMet8q2o9BqDo,12245
8
+ autogen/graph_utils.py,sha256=Bszgh51Pdpuc2o05IX6aa7uCD_p1BCqYVaipozStQlE,6416
9
+ autogen/math_utils.py,sha256=gXgTqhT1BssQ4EjPPd9tXlHgKuftuSu5DYW-lxgMx4s,10274
10
+ autogen/retrieve_utils.py,sha256=CndQ0lr7dsRGLltudqp-O_dC_4NgO6fmhzka8iXLa-g,19600
11
+ autogen/runtime_logging.py,sha256=iAJO_oddNfItIghNlTv060Ld0NybK52SzL7qu3n0vRw,4837
12
+ autogen/token_count_utils.py,sha256=XWEqxmYd5aAg-IxpCU54G1AXT75SbFNn4ZTLUXwAPYY,10306
13
+ autogen/types.py,sha256=zkSwYEfDePIsuk03IgutDPwb1QlFK-rAu23uYvQKrXE,601
14
+ autogen/version.py,sha256=M7P4XwmGG_dVWakwmieCnE9lFS3o0vUAKUO0imGjdew,248
15
+ autogen/agentchat/__init__.py,sha256=GhEKIablUdEaWlW8i7VpHwtzIVOl6N9sgbnAcT-X9jw,1091
16
+ autogen/agentchat/agent.py,sha256=r3jjZbVGkms4a8FTOXzyiQQ7PcMPVBj8zwbSJ-siwXg,4764
17
+ autogen/agentchat/assistant_agent.py,sha256=cEaYk15yyeRSE3LaguDThxzZFgTWiPJ1SxTvAvK6t68,5548
18
+ autogen/agentchat/chat.py,sha256=F7WNQc_feDg0pXwkqG0ER74jy_zRzj6NO7MVNwEQcPM,12484
19
+ autogen/agentchat/conversable_agent.py,sha256=T-lnzd8BVTvgujjRsUJ1N1KrLo2ojQ7HG6l-CCnEVAA,139387
20
+ autogen/agentchat/groupchat.py,sha256=2kzT4nf_Yexuq8YqcmJSX9TA2QoTv9yZXZ8W5Q3NpA8,83877
21
+ autogen/agentchat/user_proxy_agent.py,sha256=c-RG-Sb_O3p3QnePkOVepVI5olyfKOlsM9SQaEOcthw,7307
22
+ autogen/agentchat/utils.py,sha256=Y-FjMcwiJuO-WsgLDuXep_IU2absAMwQulCKs9QdHVc,8036
23
+ autogen/agentchat/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ autogen/agentchat/contrib/agent_builder.py,sha256=PA7iG3sbqV2K75_IMblK7POZ6VopWaU5DzrjF3YGYA0,32776
25
+ autogen/agentchat/contrib/agent_optimizer.py,sha256=dSsRIcYwZXxTWIGn_0gUl-zvDnWgOSQKyImzmkE6UPQ,22446
26
+ autogen/agentchat/contrib/captainagent.py,sha256=ZX9GBIfJR_CqSqbaz6fHQIAPPEnme-ilSetw-EJKaNw,25604
27
+ autogen/agentchat/contrib/gpt_assistant_agent.py,sha256=5aNsw8HJQKw5KumHRZekT2smnHR9e4PLRvIZzfsNPQw,25146
28
+ autogen/agentchat/contrib/img_utils.py,sha256=XEnLKeWOXoD1IiWf8IT1A3QiUE8ZEdZrjxUaJwR1WVY,14276
29
+ autogen/agentchat/contrib/llamaindex_conversable_agent.py,sha256=BSfjG4fDXjG4jpBmyAso5k1dK8JJPYWoNuL4LiYl-EM,4535
30
+ autogen/agentchat/contrib/llava_agent.py,sha256=pVKcwa_16Pg6lBfGJ6JXWUH-nAUtgW05q6KdhDESass,6330
31
+ autogen/agentchat/contrib/math_user_proxy_agent.py,sha256=Q6YI8Z3M4Ndcp8ruMtpEr16rxLi4ZnIKKnYD8ujv33I,19938
32
+ autogen/agentchat/contrib/multimodal_conversable_agent.py,sha256=vDYP6c3K1L6HaefG4gItGvlrbAa91KERJQTKZlMpe2c,5155
33
+ autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py,sha256=mgKHvKbx5dcTRMlE4yg6K6DMmfVWuIxncNHdf987Ct4,19406
34
+ autogen/agentchat/contrib/retrieve_assistant_agent.py,sha256=79igEA0r1eZYSuWKOCKkUwCV1c5yTWH295-L2-4ao4c,2424
35
+ autogen/agentchat/contrib/retrieve_user_proxy_agent.py,sha256=-iW9de1jGkTg-o86_vphSKkWyy5ESUhMotEzeXRolPc,37339
36
+ autogen/agentchat/contrib/society_of_mind_agent.py,sha256=lRF69C8ejcqPRGj5_fPtUs2NandyATw010OJB7OTdos,9087
37
+ autogen/agentchat/contrib/swarm_agent.py,sha256=KaAQefBivudN9mBjOsnZ44BPV7qJ0MhMO1h-l277XHQ,19332
38
+ autogen/agentchat/contrib/text_analyzer_agent.py,sha256=WitXX--yoGh3Xq_jC_D85Unt7UCVPdhM4MzuVJxiRSg,3563
39
+ autogen/agentchat/contrib/tool_retriever.py,sha256=xz7sIeblG0NFYHLQsPLUe9J3AenKVLgYfJ0o4eKLKZg,4529
40
+ autogen/agentchat/contrib/web_surfer.py,sha256=kAqbfuyj_lK61VUhvVUM83CYs_Hsut6eKPy388LVwL8,14563
41
+ autogen/agentchat/contrib/agent_eval/agent_eval.py,sha256=x_U63SjwRBXEkVky6BA1KOs7DxhY3qi0hMWc40YGdyo,4078
42
+ autogen/agentchat/contrib/agent_eval/criterion.py,sha256=3mt9s2C8hIjowFSq9KmcqFIYu-ZJnL-lrBFmrmSzbAI,1413
43
+ autogen/agentchat/contrib/agent_eval/critic_agent.py,sha256=mDK4Z65LyfxkmgmN5MS1_Jzl16v4IYnTsx69TLZdVNA,2070
44
+ autogen/agentchat/contrib/agent_eval/quantifier_agent.py,sha256=C7-SdCb5aAlB-MKW3ha-B8piBgTDTpTgoKm41jNUIBs,2008
45
+ autogen/agentchat/contrib/agent_eval/subcritic_agent.py,sha256=d-pCMeHyYYxo_9JUHAZEOdHNnTavrHKv4lREctN9gyg,2627
46
+ autogen/agentchat/contrib/agent_eval/task.py,sha256=cbtaJKn3mw9PjuP5hy4qSGVzKFOMM7XwDId5OtJhvSQ,1380
47
+ autogen/agentchat/contrib/capabilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
+ autogen/agentchat/contrib/capabilities/agent_capability.py,sha256=f6cBV4FcMvA7oZE1_o42RUUayC3KTkKOB7wW2fFEjso,771
49
+ autogen/agentchat/contrib/capabilities/generate_images.py,sha256=B0n9bSNovYLcSMSYwtYAwOMnx77y52jucQtGZ4RbA60,12627
50
+ autogen/agentchat/contrib/capabilities/teachability.py,sha256=6PUVPC-rCGH6D0r-xEzyXTAm8-OqjftvZFL8wmcpJ6U,19501
51
+ autogen/agentchat/contrib/capabilities/text_compressors.py,sha256=xKQwv268AVZYKK-RdZMhNyjabT-6y-lJ7a1jxepFs4Q,3080
52
+ autogen/agentchat/contrib/capabilities/transform_messages.py,sha256=RdzTnmlRS5aXA8dtxQky3P4rVlveU1aibeH40sXoKKQ,3708
53
+ autogen/agentchat/contrib/capabilities/transforms.py,sha256=4a1Gb_8ol48l-g0B7V9Mqful6A9gCizSRayhR_HudwY,25637
54
+ autogen/agentchat/contrib/capabilities/transforms_util.py,sha256=-OnVwZeHhmJhV-FkiOODpsAU8-gZkcJSwJMpctOyz8Y,4441
55
+ autogen/agentchat/contrib/capabilities/vision_capability.py,sha256=XzKKLXOffNWAowgF0f2CS050fdRvVWT0ce7F68T1q5I,10058
56
+ autogen/agentchat/contrib/captainagent/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
+ autogen/agentchat/contrib/captainagent/tools/requirements.txt,sha256=z2uZXzuO-MT_d0EPrk9G3Ct2cQeS-KTj0p7HdgqiEYg,110
58
+ autogen/agentchat/contrib/captainagent/tools/tool_description.tsv,sha256=FoTCONw59WUTNswa23ze6a2MOyvCuhZ8TZddPdU1ACE,3857
59
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py,sha256=Ps10oaxjQa2n1EOOY3ESRHaOyhoRrJAwej0PptKDeAA,1678
60
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py,sha256=xsrI0KNAX60EhtnTx6UBgh9tEkdkXSRoNzHUi-dCkMA,921
61
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py,sha256=QoE5H61B1-eVCA8lf5krUUQZj4roXyZo7ub6WRXYpk4,953
62
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py,sha256=8uFRG-9nJvhDVWNYqkZ6ULORyN_5fC9W6mhpjprh1Iw,1122
63
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py,sha256=hBxTHLLpy7DPd0j8B7TKJg2FgTGGb8v_wSQOWrZ6dug,683
64
+ autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py,sha256=JV9a-vko0RDFVNKG-sboAxqhJ_-qZJ6ZIZctSDT2F3o,870
65
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py,sha256=OnVfolA-w2iezoEXrRW4JAXRwJBS2K8NAmKcolaIHdY,919
66
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py,sha256=rg37hr7v9aSgROevjV7ZhLjXZwNIdtkmLjamSQhYBXE,2084
67
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py,sha256=5RNTYsWC4LIYQEeOPXUGSYrhaWP2CX27KlZYLWtz8DA,1807
68
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py,sha256=eu2Q09wVPbqVo63l00FOHmg1ieZKiEl8xJMDOarTVvI,1073
69
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py,sha256=eFyaqfj9J21QJpWIXuzjjXJr0E226AXj92Eyrho2K7U,646
70
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py,sha256=xHm9lx3uxw7OmTez1aNcYYeb0TgqoI-qajnhG8UZvAc,1056
71
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py,sha256=taOgWiDoRJccBRZVhi1HzC6IYESrASWBXI7ba_5nYDE,2087
72
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py,sha256=Fhthva-Zaj-5yOezzDb4R--xWVBVtmrjlAoxRMuNuE4,1902
73
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py,sha256=bXRisc_5V0JT-u1zqkdokZP8x5J2xZBPS4wdHRFZiiA,1509
74
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py,sha256=PLhNQyw1UDuFjTb1ZiGR9HkOl_CRBPLSi9XqiDVJ4OY,1312
75
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py,sha256=Wn4i4UEEayY7R1AmciKPzLucJ9-T4knM9XX2JC5xwV4,581
76
+ autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py,sha256=g-8m4HZagf2k7noReOQEnFYEEe5hIkwbXbJYRft13lU,986
77
+ autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py,sha256=KC6UEnlBNWG2TAQpPTjRsBnko73ABD20cMOXfBSrGnk,522
78
+ autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py,sha256=lK-4X9K3-0lKHzuqE4kEhJSRPt1W4g7UFP3rwc6Qmto,769
79
+ autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py,sha256=HAJzDWOR6xqGiQF3-R_QHANBNPgxul00V7-nX6DvO8E,1231
80
+ autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py,sha256=IPbostaG7GEysw0wIXwOKlSz6dbptHv_nCyKlt8C06g,912
81
+ autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py,sha256=RKyWaKWpB9HDdyGFLc3bQ7ZBHYDq_m2Pp1B_hdcLbQY,675
82
+ autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py,sha256=hr7ziqIwavG0G9o42hloHrN65mHSO_IoVhEifOOVTH8,782
83
+ autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py,sha256=RRgi5TU56Euve2qEARKW8nbQnkfdYWQbgVb8DH_wlJI,817
84
+ autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py,sha256=ciWbGhTV-i6FuxUCY_a3Tzm7y06ebu04l9dDerlAzFU,839
85
+ autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py,sha256=KcYwJeSrcHwdkm2i-kT80ZLiDuAjLGBJay2TK-gaHts,1017
86
+ autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py,sha256=xXD5ajbjjfex8BbyEjIDogPQ07pWwnzULJRgBWlSmcc,1243
87
+ autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py,sha256=6GxtJFK5UUv7rrZKdwEDtEgKOTqQEAX5Q9hCYIOE6Ro,1625
88
+ autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py,sha256=16HXCctCL8_ysHxOdmHQcHrRPCBlMiMbC-IXsZtyiYc,775
89
+ autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py,sha256=TsAJPagSYFjyknFXOWKpWv_1VXfG0ENEn2Tu-fPIL0g,1653
90
+ autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py,sha256=rJwu4rM8SC4mkO3fVg8QkmovFW1GQt7SzZzZe-jq7w4,562
91
+ autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py,sha256=r57WX8Y1juh3N0Bhg-i3HIrULugaKhzSX-Hx1Uj_4ZM,475
92
+ autogen/agentchat/contrib/graph_rag/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
93
+ autogen/agentchat/contrib/graph_rag/document.py,sha256=gpi1xivBSIL_8vWL6haEeNA7CyS5z0XuXQen-8dAypo,638
94
+ autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py,sha256=UoZxfUF1p_6kJI5qQbBR-uQW53HqLOr6ag7xuRfqmUM,4047
95
+ autogen/agentchat/contrib/graph_rag/falkor_graph_rag_capability.py,sha256=Z3ar_41q0c2qli9kErGd73A-fCoA6Vv9V8dFLafJEx4,3366
96
+ autogen/agentchat/contrib/graph_rag/graph_query_engine.py,sha256=kCdE7p_Gkp3uAK-sOGW5FQdy32IQYRW3anNtvbAATd8,1768
97
+ autogen/agentchat/contrib/graph_rag/graph_rag_capability.py,sha256=E_kVBAWCll04beUReiLs2BQHk4p4ag0aIlkvi7TE8Xc,2299
98
+ autogen/agentchat/contrib/vectordb/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
+ autogen/agentchat/contrib/vectordb/base.py,sha256=50MchILyOfBHPuBg1G1nM2vIuzKfoQKssCXKvbMKruU,9151
100
+ autogen/agentchat/contrib/vectordb/chromadb.py,sha256=2dFVBd_Icj_GJ4XOVC5D4LYNFXtzoDmXux-WuTW7EDw,13480
101
+ autogen/agentchat/contrib/vectordb/mongodb.py,sha256=iD7ayIrTZ9V3xV0nOOWpQ3U8GWDDmVMB8wW_o5CKEtY,23192
102
+ autogen/agentchat/contrib/vectordb/pgvectordb.py,sha256=RxTvZciJkT1oty4CFer-gVvGX0sRHp_xFgQPh0de6HM,39240
103
+ autogen/agentchat/contrib/vectordb/qdrant.py,sha256=SVho_uZPfPjFamz2raPudx-wFOx1wNCf90UvK_TozcI,13823
104
+ autogen/agentchat/contrib/vectordb/utils.py,sha256=skh86LXkbW5owCehkj887D7cIMxgT35Mk4vu75SWFIc,4435
105
+ autogen/cache/__init__.py,sha256=uXnBVq_fGjRt5ypTrTtUuZ1KKFKOqR2iOiT27G0Az28,336
106
+ autogen/cache/abstract_cache_base.py,sha256=lIx9XeFhgNGRrsC4ferOUmGxskyMBu1wC6KTvbjO9j8,2388
107
+ autogen/cache/cache.py,sha256=BH3892nm3DO4q0HIDLNh--zp6vfefmyOqULJZmmRq8s,6408
108
+ autogen/cache/cache_factory.py,sha256=xmTCC_GY2gc3MmxNzjzrH-V2vbsHYNoQwoAr6ifSQ08,3038
109
+ autogen/cache/cosmos_db_cache.py,sha256=9BlJc3hmyAB16leb9MAfgnpX58eOpRadlh1P4FzRdzA,5797
110
+ autogen/cache/disk_cache.py,sha256=fHWga6HmMBLvI9o8Et3vIgeqsEdKCNaHSXgrw0rSot8,3357
111
+ autogen/cache/in_memory_cache.py,sha256=CXd8TRcCh4vOTgvLqUPKnQfN8fCEQJib5aR4RxZWBu4,1849
112
+ autogen/cache/redis_cache.py,sha256=r6vzXbU8nZkqErcB0KiEI7v7D8icpuBq7ZM9oxnHFdA,4137
113
+ autogen/coding/__init__.py,sha256=bbs19EUNBaAcISEavwfJssKS-_QIfNcTWKkM9u3wSTU,791
114
+ autogen/coding/base.py,sha256=t33mMsnDpbb6q3JXBqtsIon-Cg7qjZWar6pEu_WjoqM,3567
115
+ autogen/coding/docker_commandline_code_executor.py,sha256=K_Jlq7_SsHHHndpBxRgXRql6ylxoB-i986JnDDKuOSA,9573
116
+ autogen/coding/factory.py,sha256=IT4DTdtRU8pRMfM5dzTAaXjdOno63w4xHrg0hD5v9ks,1868
117
+ autogen/coding/func_with_reqs.py,sha256=R2K5L9JuR45T3hCYxQBckvpU3okuL7D99CIEpZqRojY,6372
118
+ autogen/coding/local_commandline_code_executor.py,sha256=fdc-FBhZ27pKnR9vqWAIndSNvcV_LYvdJ0kTJrxnnrY,16721
119
+ autogen/coding/markdown_code_extractor.py,sha256=U3_40I2tjSVOtAv6XTEqgmiUnT6Ya2W4n8TZeCTxHjM,1568
120
+ autogen/coding/utils.py,sha256=2QuYkXedQB7u8sv9hd3W7PVZr9RXT_UmpRDxEYAUms0,2075
121
+ autogen/coding/jupyter/__init__.py,sha256=FfaEWT1EUW2l44rjmDDQmj60W76H-jIHmVSP1ZdouFc,795
122
+ autogen/coding/jupyter/base.py,sha256=X4znVYHNqIngIcE5zjdj95Ev2F6mzjuh1prfkUcLcrQ,988
123
+ autogen/coding/jupyter/docker_jupyter_server.py,sha256=RfO2k6A75pPXLywZUGMg88pur7w8Di2Z9U7L936enEU,5668
124
+ autogen/coding/jupyter/embedded_ipython_code_executor.py,sha256=IeSEneQB3ohTCqg9ArswEl5Mi0uA-TU8bJvMuXFKbmU,8061
125
+ autogen/coding/jupyter/jupyter_client.py,sha256=DuIozfloQJniSm44em6CXHoDcvuKkN2j9I3ZnP-_18o,8269
126
+ autogen/coding/jupyter/jupyter_code_executor.py,sha256=hssTdUKsHo8a0jQBg3jMAp3HvEhEweQpLUCCGLiEPdk,6349
127
+ autogen/coding/jupyter/local_jupyter_server.py,sha256=MN6jRVR_TAK_i2GbgoNQiXvSfYuevgS_7VwawntN7cA,6377
128
+ autogen/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
129
+ autogen/io/__init__.py,sha256=LARrer2Vn88okcf-EBq5zn6vAHt9yAs2rh3cl1_HdMM,561
130
+ autogen/io/base.py,sha256=xIK9vTat6HHcwMndGNFcY17B3y62C8bRTk3tezf7A_w,3425
131
+ autogen/io/console.py,sha256=lYzBsy7VWTsTP0Evxsd6tarVYR1v8btjItoCRxe3vg4,1407
132
+ autogen/io/websockets.py,sha256=qK2DLDTx5rGtuhsRPpV-xleuLCBy4Oorpc5WggKHcf4,7264
133
+ autogen/logger/__init__.py,sha256=1aNIdfAhzJjf8qJSqsgCCEbZcBGIcJdiXbS1G6iMns8,403
134
+ autogen/logger/base_logger.py,sha256=boarsJGfgD_vZYqDROsHyauouQaLdeQkP9xMfJEMWWo,5159
135
+ autogen/logger/file_logger.py,sha256=faApnlfmJ42x0JD5JDmOsBpNxMqwZY9HMJh6LGXMKYg,10402
136
+ autogen/logger/logger_factory.py,sha256=RNr12g2pPTeBEJzeYrbp3KWeJxpZnEGvlufYiFeyq8A,941
137
+ autogen/logger/logger_utils.py,sha256=-P3_YWBEFsTF8MgQ9oc5AqLb6fSdjDJZ8FOg5hs8oMM,1436
138
+ autogen/logger/sqlite_logger.py,sha256=vkZtYLWKKGDHh0GCTbp_4PWBl9-yjhzii1cnQ7-lQkQ,16430
139
+ autogen/oai/__init__.py,sha256=6HF5dNTEgwi-rM-A273XtVBSyvkIsKtNpccsoNXWdqY,911
140
+ autogen/oai/anthropic.py,sha256=ibeH8-NLfeNDKpGdjJbh9dPoUWJGzBszguKaWzJJLzs,17249
141
+ autogen/oai/bedrock.py,sha256=RHKqOi4bCMLor1r8CAMC4o4NTBtfVRc3muiN-_bZlJg,23787
142
+ autogen/oai/cerebras.py,sha256=vxvlIJGek_IJsS7tKQkq1se__xLg-Mzjc4xEW06lhTQ,10894
143
+ autogen/oai/client.py,sha256=HR8ATrTlNoSM8fr0fH9cmKR-lxr3Rd62kBI0aj-eoNg,52615
144
+ autogen/oai/client_utils.py,sha256=W9RD6V3XPpelDqPwjG412go4qXfYWDPmKur68s-Siu0,7282
145
+ autogen/oai/cohere.py,sha256=giMIRomeAEd3y0QsulmWYYLXXCfsqY0ojKG4UzwQ2SI,18513
146
+ autogen/oai/completion.py,sha256=dT2LEjmRUMXx0UR7OKs6zYQH-cDtW5m0vWvwXXOjmvk,53652
147
+ autogen/oai/gemini.py,sha256=YNrwGKwPVglfUhx2XPph9AbPN0b5IbPMaT0njWPEXjI,20595
148
+ autogen/oai/groq.py,sha256=gpLe1UJZMtkJAks2mj40aksvMcQ0oBjgOxRuTVupG7s,11164
149
+ autogen/oai/mistral.py,sha256=1xybwfihh6n2HyLlCNNebT01SYVIwNj9ClIms92ySak,11414
150
+ autogen/oai/ollama.py,sha256=EesTalPdgvNIhXbeGkTkk9i_zqhuKrSNZjzfg__F3JI,25608
151
+ autogen/oai/openai_utils.py,sha256=pLNthT0PYTY8Nxvh5-zm1YE7a-9YOHWq9oam0NwwgIM,35203
152
+ autogen/oai/together.py,sha256=AfEx2Dt4limeVvnCibtwvs9OuJkS1wcYFdA-P-gDzRw,13411
153
+ ag2-0.4.1.dist-info/LICENSE,sha256=GEFQVNayAR-S_rQD5l8hPdgvgyktVdy4Bx5-v90IfRI,11384
154
+ ag2-0.4.1.dist-info/METADATA,sha256=ZU_ef6Ez-fNhWQXZ6o0QjJdOrsbYPVpTd374wlXf_eE,25246
155
+ ag2-0.4.1.dist-info/NOTICE.md,sha256=ucvou1bE6i2s40qyuU9RL0TeIVG01VhXoQ59EngtEz4,1317
156
+ ag2-0.4.1.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
157
+ ag2-0.4.1.dist-info/top_level.txt,sha256=qRZ2MW8yuy0LtOLpeZndl4H1buusjxhwD6c9AXbVqKQ,8
158
+ ag2-0.4.1.dist-info/RECORD,,
@@ -117,6 +117,7 @@ Suggest no more than {max_agents} experts with their name according to the follo
117
117
  # Task requirement
118
118
  - Expert's name should follow the format: [skill]_Expert.
119
119
  - Only reply the names of the experts, separated by ",".
120
+ - If coding skills are required, they should be limited to Python and Shell.
120
121
  For example: Python_Expert, Math_Expert, ... """
121
122
 
122
123
  AGENT_SYS_MSG_PROMPT = """# Your goal
@@ -0,0 +1,107 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ from typing import Dict, List, Literal, Optional, Union
8
+
9
+ import autogen
10
+ from autogen.agentchat.contrib.agent_eval.criterion import Criterion
11
+ from autogen.agentchat.contrib.agent_eval.critic_agent import CriticAgent
12
+ from autogen.agentchat.contrib.agent_eval.quantifier_agent import QuantifierAgent
13
+ from autogen.agentchat.contrib.agent_eval.subcritic_agent import SubCriticAgent
14
+ from autogen.agentchat.contrib.agent_eval.task import Task
15
+
16
+
17
+ def generate_criteria(
18
+ llm_config: Optional[Union[Dict, Literal[False]]] = None,
19
+ task: Task = None,
20
+ additional_instructions: str = "",
21
+ max_round=2,
22
+ use_subcritic: bool = False,
23
+ ):
24
+ """
25
+ Creates a list of criteria for evaluating the utility of a given task.
26
+ Args:
27
+ llm_config (dict or bool): llm inference configuration.
28
+ task (Task): The task to evaluate.
29
+ additional_instructions (str): Additional instructions for the criteria agent.
30
+ max_round (int): The maximum number of rounds to run the conversation.
31
+ use_subcritic (bool): Whether to use the subcritic agent to generate subcriteria.
32
+ Returns:
33
+ list: A list of Criterion objects for evaluating the utility of the given task.
34
+ """
35
+ critic = CriticAgent(
36
+ system_message=CriticAgent.DEFAULT_SYSTEM_MESSAGE + "\n" + additional_instructions,
37
+ llm_config=llm_config,
38
+ )
39
+
40
+ critic_user = autogen.UserProxyAgent(
41
+ name="critic_user",
42
+ max_consecutive_auto_reply=0, # terminate without auto-reply
43
+ human_input_mode="NEVER",
44
+ code_execution_config={"use_docker": False},
45
+ )
46
+
47
+ agents = [critic_user, critic]
48
+
49
+ if use_subcritic:
50
+ subcritic = SubCriticAgent(
51
+ llm_config=llm_config,
52
+ )
53
+ agents.append(subcritic)
54
+
55
+ groupchat = autogen.GroupChat(
56
+ agents=agents, messages=[], max_round=max_round, speaker_selection_method="round_robin"
57
+ )
58
+ critic_manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_config)
59
+
60
+ critic_user.initiate_chat(critic_manager, message=task.get_sys_message())
61
+ criteria = critic_user.last_message()
62
+ content = criteria["content"]
63
+ # need to strip out any extra code around the returned json
64
+ content = content[content.find("[") : content.rfind("]") + 1]
65
+ criteria = Criterion.parse_json_str(content)
66
+ return criteria
67
+
68
+
69
+ def quantify_criteria(
70
+ llm_config: Optional[Union[Dict, Literal[False]]] = None,
71
+ criteria: List[Criterion] = None,
72
+ task: Task = None,
73
+ test_case: str = "",
74
+ ground_truth: str = "",
75
+ ):
76
+ """
77
+ Quantifies the performance of a system using the provided criteria.
78
+ Args:
79
+ llm_config (dict or bool): llm inference configuration.
80
+ criteria ([Criterion]): A list of criteria for evaluating the utility of a given task.
81
+ task (Task): The task to evaluate.
82
+ test_case (str): The test case to evaluate.
83
+ ground_truth (str): The ground truth for the test case.
84
+ Returns:
85
+ dict: A dictionary where the keys are the criteria and the values are the assessed performance based on accepted values for each criteria.
86
+ """
87
+ quantifier = QuantifierAgent(
88
+ llm_config=llm_config,
89
+ )
90
+
91
+ quantifier_user = autogen.UserProxyAgent(
92
+ name="quantifier_user",
93
+ max_consecutive_auto_reply=0, # terminate without auto-reply
94
+ human_input_mode="NEVER",
95
+ code_execution_config={"use_docker": False},
96
+ )
97
+
98
+ quantifier_user.initiate_chat( # noqa: F841
99
+ quantifier,
100
+ message=task.get_sys_message()
101
+ + "Evaluation dictionary: "
102
+ + Criterion.write_json(criteria)
103
+ + "actual test case to evaluate: "
104
+ + test_case,
105
+ )
106
+ quantified_results = quantifier_user.last_message()
107
+ return {"actual_success": ground_truth, "estimated_performance": quantified_results["content"]}
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ from __future__ import annotations
8
+
9
+ import json
10
+ from typing import List
11
+
12
+ import pydantic_core
13
+ from pydantic import BaseModel
14
+ from pydantic.json import pydantic_encoder
15
+
16
+
17
+ class Criterion(BaseModel):
18
+ """
19
+ A class that represents a criterion for agent evaluation.
20
+ """
21
+
22
+ name: str
23
+ description: str
24
+ accepted_values: List[str]
25
+ sub_criteria: List[Criterion] = list()
26
+
27
+ @staticmethod
28
+ def parse_json_str(criteria: str):
29
+ """
30
+ Create a list of Criterion objects from a json string.
31
+ Args:
32
+ criteria (str): Json string that represents the criteria
33
+ returns:
34
+ [Criterion]: A list of Criterion objects that represents the json criteria information.
35
+ """
36
+ return [Criterion(**crit) for crit in json.loads(criteria)]
37
+
38
+ @staticmethod
39
+ def write_json(criteria):
40
+ """
41
+ Create a json string from a list of Criterion objects.
42
+ Args:
43
+ criteria ([Criterion]): A list of Criterion objects.
44
+ Returns:
45
+ str: A json string that represents the list of Criterion objects.
46
+ """
47
+ return json.dumps([crit.model_dump() for crit in criteria], indent=2)
@@ -0,0 +1,47 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ from typing import Optional
8
+
9
+ from autogen.agentchat.conversable_agent import ConversableAgent
10
+
11
+
12
+ class CriticAgent(ConversableAgent):
13
+ """
14
+ An agent for creating list of criteria for evaluating the utility of a given task.
15
+ """
16
+
17
+ DEFAULT_SYSTEM_MESSAGE = """You are a helpful assistant. You suggest criteria for evaluating different tasks. They should be distinguishable, quantifiable and not redundant.
18
+ Convert the evaluation criteria into a list where each item is a criteria which consists of the following dictionary as follows
19
+ {"name": name of the criterion, "description": criteria description , "accepted_values": possible accepted inputs for this key}
20
+ Make sure "accepted_values" include the acceptable inputs for each key that are fine-grained and preferably multi-graded levels and "description" includes the criterion description.
21
+ Output just the criteria string you have created, no code.
22
+ """
23
+
24
+ DEFAULT_DESCRIPTION = "An AI agent for creating list criteria for evaluating the utility of a given task."
25
+
26
+ def __init__(
27
+ self,
28
+ name="critic",
29
+ system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE,
30
+ description: Optional[str] = DEFAULT_DESCRIPTION,
31
+ **kwargs,
32
+ ):
33
+ """
34
+ Args:
35
+ name (str): agent name.
36
+ system_message (str): system message for the ChatCompletion inference.
37
+ Please override this attribute if you want to reprogram the agent.
38
+ description (str): The description of the agent.
39
+ **kwargs (dict): Please refer to other kwargs in
40
+ [ConversableAgent](../../conversable_agent#__init__).
41
+ """
42
+ super().__init__(
43
+ name=name,
44
+ system_message=system_message,
45
+ description=description,
46
+ **kwargs,
47
+ )
@@ -0,0 +1,42 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ from typing import Optional
8
+
9
+ from autogen.agentchat.conversable_agent import ConversableAgent
10
+
11
+
12
+ class QuantifierAgent(ConversableAgent):
13
+ """
14
+ An agent for quantifying the performance of a system using the provided criteria.
15
+ """
16
+
17
+ DEFAULT_SYSTEM_MESSAGE = """"You are a helpful assistant. You quantify the output of different tasks based on the given criteria.
18
+ The criterion is given in a json list format where each element is a distinct criteria.
19
+ The each element is a dictionary as follows {"name": name of the criterion, "description": criteria description , "accepted_values": possible accepted inputs for this key}
20
+ You are going to quantify each of the crieria for a given task based on the task description.
21
+ Return a dictionary where the keys are the criteria and the values are the assessed performance based on accepted values for each criteria.
22
+ Return only the dictionary, no code."""
23
+
24
+ DEFAULT_DESCRIPTION = "An AI agent for quantifing the performance of a system using the provided criteria."
25
+
26
+ def __init__(
27
+ self,
28
+ name="quantifier",
29
+ system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE,
30
+ description: Optional[str] = DEFAULT_DESCRIPTION,
31
+ **kwargs,
32
+ ):
33
+ """
34
+ Args:
35
+ name (str): agent name.
36
+ system_message (str): system message for the ChatCompletion inference.
37
+ Please override this attribute if you want to reprogram the agent.
38
+ description (str): The description of the agent.
39
+ **kwargs (dict): Please refer to other kwargs in
40
+ [ConversableAgent](../../conversable_agent#__init__).
41
+ """
42
+ super().__init__(name=name, system_message=system_message, description=description, **kwargs)
@@ -0,0 +1,48 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ from typing import Optional
8
+
9
+ from autogen.agentchat.conversable_agent import ConversableAgent
10
+
11
+
12
+ class SubCriticAgent(ConversableAgent):
13
+ """
14
+ An agent for creating subcriteria from a given list of criteria for evaluating the utility of a given task.
15
+ """
16
+
17
+ DEFAULT_SYSTEM_MESSAGE = """You are a helpful assistant to the critic agent. You suggest sub criteria for evaluating different tasks based on the criteria provided by the critic agent (if you feel it is needed).
18
+ They should be distinguishable, quantifiable, and related to the overall theme of the critic's provided criteria.
19
+ You operate by taking in the description of the criteria. You then create a new key called sub criteria where you provide the sub criteria for the given criteria.
20
+ The value of the sub_criteria is a dictionary where the keys are the subcriteria and each value is as follows {"description": sub criteria description , "accepted_values": possible accepted inputs for this key}
21
+ Do this for each criteria provided by the critic (removing the criteria's accepted values). "accepted_values" include the acceptable inputs for each key that are fine-grained and preferably multi-graded levels. "description" includes the criterion description.
22
+ Once you have created the sub criteria for the given criteria, you return the json (make sure to include the contents of the critic's dictionary in the final dictionary as well).
23
+ Make sure to return a valid json and no code"""
24
+
25
+ DEFAULT_DESCRIPTION = "An AI agent for creating subcriteria from a given list of criteria."
26
+
27
+ def __init__(
28
+ self,
29
+ name="subcritic",
30
+ system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE,
31
+ description: Optional[str] = DEFAULT_DESCRIPTION,
32
+ **kwargs,
33
+ ):
34
+ """
35
+ Args:
36
+ name (str): agent name.
37
+ system_message (str): system message for the ChatCompletion inference.
38
+ Please override this attribute if you want to reprogram the agent.
39
+ description (str): The description of the agent.
40
+ **kwargs (dict): Please refer to other kwargs in
41
+ [ConversableAgent](../../conversable_agent#__init__).
42
+ """
43
+ super().__init__(
44
+ name=name,
45
+ system_message=system_message,
46
+ description=description,
47
+ **kwargs,
48
+ )
@@ -0,0 +1,43 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+ # Portions derived from https://github.com/microsoft/autogen are under the MIT License.
6
+ # SPDX-License-Identifier: MIT
7
+ import json
8
+
9
+ from pydantic import BaseModel
10
+
11
+
12
+ class Task(BaseModel):
13
+ """
14
+ Class representing a task for agent completion, includes example agent execution for criteria generation.
15
+ """
16
+
17
+ name: str
18
+ description: str
19
+ successful_response: str
20
+ failed_response: str
21
+
22
+ def get_sys_message(self):
23
+ return f"""Task: {self.name}.
24
+ Task description: {self.description}
25
+ Task successful example: {self.successful_response}
26
+ Task failed example: {self.failed_response}
27
+ """
28
+
29
+ @staticmethod
30
+ def parse_json_str(task: str):
31
+ """
32
+ Create a Task object from a json object.
33
+ Args:
34
+ json_data (dict): A dictionary that represents the task.
35
+ Returns:
36
+ Task: A Task object that represents the json task information.
37
+ """
38
+ json_data = json.loads(task)
39
+ name = json_data.get("name")
40
+ description = json_data.get("description")
41
+ successful_response = json_data.get("successful_response")
42
+ failed_response = json_data.get("failed_response")
43
+ return Task(name, description, successful_response, failed_response)
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2023 - 2024, Owners of https://github.com/ag2ai
2
+ #
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ def calculate_correlation(csv_path: str, column1: str, column2: str, method: str = "pearson") -> float:
5
+ """
6
+ Calculate the correlation between two columns in a CSV file.
7
+
8
+ Args:
9
+ csv_path (str): The path to the CSV file.
10
+ column1 (str): The name of the first column.
11
+ column2 (str): The name of the second column.
12
+ method (str or callable, optional): The method used to calculate the correlation.
13
+ - 'pearson' (default): Pearson correlation coefficient.
14
+ - 'kendall': Kendall Tau correlation coefficient.
15
+ - 'spearman': Spearman rank correlation coefficient.
16
+ - callable: A custom correlation function that takes two arrays and returns a scalar.
17
+
18
+ Returns:
19
+ float: The correlation coefficient between the two columns.
20
+ """
21
+ import pandas as pd
22
+
23
+ # Read the CSV file into a pandas DataFrame
24
+ df = pd.read_csv(csv_path)
25
+
26
+ # Select the specified columns
27
+ selected_columns = df[[column1, column2]]
28
+
29
+ # Calculate the correlation based on the specified method
30
+ if method == "pearson":
31
+ correlation = selected_columns.corr().iloc[0, 1]
32
+ elif method == "kendall":
33
+ correlation = selected_columns.corr(method="kendall").iloc[0, 1]
34
+ elif method == "spearman":
35
+ correlation = selected_columns.corr(method="spearman").iloc[0, 1]
36
+ elif callable(method):
37
+ correlation = selected_columns.corr(method=method).iloc[0, 1]
38
+ else:
39
+ raise ValueError("Invalid correlation method. Please choose 'pearson', 'kendall', 'spearman', or a callable.")
40
+
41
+ return correlation