ag2 0.4.1__py3-none-any.whl → 0.4.2b1__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 (161) hide show
  1. ag2-0.4.2b1.dist-info/METADATA +19 -0
  2. ag2-0.4.2b1.dist-info/RECORD +6 -0
  3. ag2-0.4.2b1.dist-info/top_level.txt +1 -0
  4. ag2-0.4.1.dist-info/METADATA +0 -500
  5. ag2-0.4.1.dist-info/RECORD +0 -158
  6. ag2-0.4.1.dist-info/top_level.txt +0 -1
  7. autogen/__init__.py +0 -17
  8. autogen/_pydantic.py +0 -116
  9. autogen/agentchat/__init__.py +0 -42
  10. autogen/agentchat/agent.py +0 -142
  11. autogen/agentchat/assistant_agent.py +0 -85
  12. autogen/agentchat/chat.py +0 -306
  13. autogen/agentchat/contrib/__init__.py +0 -0
  14. autogen/agentchat/contrib/agent_builder.py +0 -788
  15. autogen/agentchat/contrib/agent_eval/agent_eval.py +0 -107
  16. autogen/agentchat/contrib/agent_eval/criterion.py +0 -47
  17. autogen/agentchat/contrib/agent_eval/critic_agent.py +0 -47
  18. autogen/agentchat/contrib/agent_eval/quantifier_agent.py +0 -42
  19. autogen/agentchat/contrib/agent_eval/subcritic_agent.py +0 -48
  20. autogen/agentchat/contrib/agent_eval/task.py +0 -43
  21. autogen/agentchat/contrib/agent_optimizer.py +0 -450
  22. autogen/agentchat/contrib/capabilities/__init__.py +0 -0
  23. autogen/agentchat/contrib/capabilities/agent_capability.py +0 -21
  24. autogen/agentchat/contrib/capabilities/generate_images.py +0 -297
  25. autogen/agentchat/contrib/capabilities/teachability.py +0 -406
  26. autogen/agentchat/contrib/capabilities/text_compressors.py +0 -72
  27. autogen/agentchat/contrib/capabilities/transform_messages.py +0 -92
  28. autogen/agentchat/contrib/capabilities/transforms.py +0 -565
  29. autogen/agentchat/contrib/capabilities/transforms_util.py +0 -120
  30. autogen/agentchat/contrib/capabilities/vision_capability.py +0 -217
  31. autogen/agentchat/contrib/captainagent/tools/__init__.py +0 -0
  32. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_correlation.py +0 -41
  33. autogen/agentchat/contrib/captainagent/tools/data_analysis/calculate_skewness_and_kurtosis.py +0 -29
  34. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_iqr.py +0 -29
  35. autogen/agentchat/contrib/captainagent/tools/data_analysis/detect_outlier_zscore.py +0 -29
  36. autogen/agentchat/contrib/captainagent/tools/data_analysis/explore_csv.py +0 -22
  37. autogen/agentchat/contrib/captainagent/tools/data_analysis/shapiro_wilk_test.py +0 -31
  38. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_download.py +0 -26
  39. autogen/agentchat/contrib/captainagent/tools/information_retrieval/arxiv_search.py +0 -55
  40. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_image.py +0 -54
  41. autogen/agentchat/contrib/captainagent/tools/information_retrieval/extract_pdf_text.py +0 -39
  42. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_wikipedia_text.py +0 -22
  43. autogen/agentchat/contrib/captainagent/tools/information_retrieval/get_youtube_caption.py +0 -35
  44. autogen/agentchat/contrib/captainagent/tools/information_retrieval/image_qa.py +0 -61
  45. autogen/agentchat/contrib/captainagent/tools/information_retrieval/optical_character_recognition.py +0 -62
  46. autogen/agentchat/contrib/captainagent/tools/information_retrieval/perform_web_search.py +0 -48
  47. autogen/agentchat/contrib/captainagent/tools/information_retrieval/scrape_wikipedia_tables.py +0 -34
  48. autogen/agentchat/contrib/captainagent/tools/information_retrieval/transcribe_audio_file.py +0 -22
  49. autogen/agentchat/contrib/captainagent/tools/information_retrieval/youtube_download.py +0 -36
  50. autogen/agentchat/contrib/captainagent/tools/math/calculate_circle_area_from_diameter.py +0 -22
  51. autogen/agentchat/contrib/captainagent/tools/math/calculate_day_of_the_week.py +0 -19
  52. autogen/agentchat/contrib/captainagent/tools/math/calculate_fraction_sum.py +0 -29
  53. autogen/agentchat/contrib/captainagent/tools/math/calculate_matrix_power.py +0 -32
  54. autogen/agentchat/contrib/captainagent/tools/math/calculate_reflected_point.py +0 -17
  55. autogen/agentchat/contrib/captainagent/tools/math/complex_numbers_product.py +0 -26
  56. autogen/agentchat/contrib/captainagent/tools/math/compute_currency_conversion.py +0 -24
  57. autogen/agentchat/contrib/captainagent/tools/math/count_distinct_permutations.py +0 -28
  58. autogen/agentchat/contrib/captainagent/tools/math/evaluate_expression.py +0 -29
  59. autogen/agentchat/contrib/captainagent/tools/math/find_continuity_point.py +0 -35
  60. autogen/agentchat/contrib/captainagent/tools/math/fraction_to_mixed_numbers.py +0 -40
  61. autogen/agentchat/contrib/captainagent/tools/math/modular_inverse_sum.py +0 -23
  62. autogen/agentchat/contrib/captainagent/tools/math/simplify_mixed_numbers.py +0 -37
  63. autogen/agentchat/contrib/captainagent/tools/math/sum_of_digit_factorials.py +0 -16
  64. autogen/agentchat/contrib/captainagent/tools/math/sum_of_primes_below.py +0 -16
  65. autogen/agentchat/contrib/captainagent/tools/requirements.txt +0 -10
  66. autogen/agentchat/contrib/captainagent/tools/tool_description.tsv +0 -34
  67. autogen/agentchat/contrib/captainagent.py +0 -490
  68. autogen/agentchat/contrib/gpt_assistant_agent.py +0 -545
  69. autogen/agentchat/contrib/graph_rag/__init__.py +0 -0
  70. autogen/agentchat/contrib/graph_rag/document.py +0 -30
  71. autogen/agentchat/contrib/graph_rag/falkor_graph_query_engine.py +0 -111
  72. autogen/agentchat/contrib/graph_rag/falkor_graph_rag_capability.py +0 -81
  73. autogen/agentchat/contrib/graph_rag/graph_query_engine.py +0 -56
  74. autogen/agentchat/contrib/graph_rag/graph_rag_capability.py +0 -64
  75. autogen/agentchat/contrib/img_utils.py +0 -390
  76. autogen/agentchat/contrib/llamaindex_conversable_agent.py +0 -123
  77. autogen/agentchat/contrib/llava_agent.py +0 -176
  78. autogen/agentchat/contrib/math_user_proxy_agent.py +0 -471
  79. autogen/agentchat/contrib/multimodal_conversable_agent.py +0 -128
  80. autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py +0 -325
  81. autogen/agentchat/contrib/retrieve_assistant_agent.py +0 -56
  82. autogen/agentchat/contrib/retrieve_user_proxy_agent.py +0 -705
  83. autogen/agentchat/contrib/society_of_mind_agent.py +0 -203
  84. autogen/agentchat/contrib/swarm_agent.py +0 -463
  85. autogen/agentchat/contrib/text_analyzer_agent.py +0 -76
  86. autogen/agentchat/contrib/tool_retriever.py +0 -120
  87. autogen/agentchat/contrib/vectordb/__init__.py +0 -0
  88. autogen/agentchat/contrib/vectordb/base.py +0 -243
  89. autogen/agentchat/contrib/vectordb/chromadb.py +0 -326
  90. autogen/agentchat/contrib/vectordb/mongodb.py +0 -559
  91. autogen/agentchat/contrib/vectordb/pgvectordb.py +0 -958
  92. autogen/agentchat/contrib/vectordb/qdrant.py +0 -334
  93. autogen/agentchat/contrib/vectordb/utils.py +0 -126
  94. autogen/agentchat/contrib/web_surfer.py +0 -305
  95. autogen/agentchat/conversable_agent.py +0 -2908
  96. autogen/agentchat/groupchat.py +0 -1668
  97. autogen/agentchat/user_proxy_agent.py +0 -109
  98. autogen/agentchat/utils.py +0 -207
  99. autogen/browser_utils.py +0 -291
  100. autogen/cache/__init__.py +0 -10
  101. autogen/cache/abstract_cache_base.py +0 -78
  102. autogen/cache/cache.py +0 -182
  103. autogen/cache/cache_factory.py +0 -85
  104. autogen/cache/cosmos_db_cache.py +0 -150
  105. autogen/cache/disk_cache.py +0 -109
  106. autogen/cache/in_memory_cache.py +0 -61
  107. autogen/cache/redis_cache.py +0 -128
  108. autogen/code_utils.py +0 -745
  109. autogen/coding/__init__.py +0 -22
  110. autogen/coding/base.py +0 -113
  111. autogen/coding/docker_commandline_code_executor.py +0 -262
  112. autogen/coding/factory.py +0 -45
  113. autogen/coding/func_with_reqs.py +0 -203
  114. autogen/coding/jupyter/__init__.py +0 -22
  115. autogen/coding/jupyter/base.py +0 -32
  116. autogen/coding/jupyter/docker_jupyter_server.py +0 -164
  117. autogen/coding/jupyter/embedded_ipython_code_executor.py +0 -182
  118. autogen/coding/jupyter/jupyter_client.py +0 -224
  119. autogen/coding/jupyter/jupyter_code_executor.py +0 -161
  120. autogen/coding/jupyter/local_jupyter_server.py +0 -168
  121. autogen/coding/local_commandline_code_executor.py +0 -410
  122. autogen/coding/markdown_code_extractor.py +0 -44
  123. autogen/coding/utils.py +0 -57
  124. autogen/exception_utils.py +0 -46
  125. autogen/extensions/__init__.py +0 -0
  126. autogen/formatting_utils.py +0 -76
  127. autogen/function_utils.py +0 -362
  128. autogen/graph_utils.py +0 -148
  129. autogen/io/__init__.py +0 -15
  130. autogen/io/base.py +0 -105
  131. autogen/io/console.py +0 -43
  132. autogen/io/websockets.py +0 -213
  133. autogen/logger/__init__.py +0 -11
  134. autogen/logger/base_logger.py +0 -140
  135. autogen/logger/file_logger.py +0 -287
  136. autogen/logger/logger_factory.py +0 -29
  137. autogen/logger/logger_utils.py +0 -42
  138. autogen/logger/sqlite_logger.py +0 -459
  139. autogen/math_utils.py +0 -356
  140. autogen/oai/__init__.py +0 -33
  141. autogen/oai/anthropic.py +0 -428
  142. autogen/oai/bedrock.py +0 -606
  143. autogen/oai/cerebras.py +0 -270
  144. autogen/oai/client.py +0 -1148
  145. autogen/oai/client_utils.py +0 -167
  146. autogen/oai/cohere.py +0 -453
  147. autogen/oai/completion.py +0 -1216
  148. autogen/oai/gemini.py +0 -469
  149. autogen/oai/groq.py +0 -281
  150. autogen/oai/mistral.py +0 -279
  151. autogen/oai/ollama.py +0 -582
  152. autogen/oai/openai_utils.py +0 -811
  153. autogen/oai/together.py +0 -343
  154. autogen/retrieve_utils.py +0 -487
  155. autogen/runtime_logging.py +0 -163
  156. autogen/token_count_utils.py +0 -259
  157. autogen/types.py +0 -20
  158. autogen/version.py +0 -7
  159. {ag2-0.4.1.dist-info → ag2-0.4.2b1.dist-info}/LICENSE +0 -0
  160. {ag2-0.4.1.dist-info → ag2-0.4.2b1.dist-info}/NOTICE.md +0 -0
  161. {ag2-0.4.1.dist-info → ag2-0.4.2b1.dist-info}/WHEEL +0 -0
@@ -1,158 +0,0 @@
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,,
@@ -1 +0,0 @@
1
- autogen
autogen/__init__.py DELETED
@@ -1,17 +0,0 @@
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 logging
8
-
9
- from .agentchat import *
10
- from .code_utils import DEFAULT_MODEL, FAST_MODEL
11
- from .exception_utils import *
12
- from .oai import *
13
- from .version import __version__
14
-
15
- # Set the root logger.
16
- logger = logging.getLogger(__name__)
17
- logger.setLevel(logging.INFO)
autogen/_pydantic.py DELETED
@@ -1,116 +0,0 @@
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 Any, Dict, Optional, Tuple, Type, Union, get_args
8
-
9
- from pydantic import BaseModel
10
- from pydantic.version import VERSION as PYDANTIC_VERSION
11
- from typing_extensions import get_origin
12
-
13
- __all__ = ("JsonSchemaValue", "model_dump", "model_dump_json", "type2schema", "evaluate_forwardref")
14
-
15
- PYDANTIC_V1 = PYDANTIC_VERSION.startswith("1.")
16
-
17
- if not PYDANTIC_V1:
18
- from pydantic import TypeAdapter
19
- from pydantic._internal._typing_extra import eval_type_lenient as evaluate_forwardref
20
- from pydantic.json_schema import JsonSchemaValue
21
-
22
- def type2schema(t: Any) -> JsonSchemaValue:
23
- """Convert a type to a JSON schema
24
-
25
- Args:
26
- t (Type): The type to convert
27
-
28
- Returns:
29
- JsonSchemaValue: The JSON schema
30
- """
31
- return TypeAdapter(t).json_schema()
32
-
33
- def model_dump(model: BaseModel) -> Dict[str, Any]:
34
- """Convert a pydantic model to a dict
35
-
36
- Args:
37
- model (BaseModel): The model to convert
38
-
39
- Returns:
40
- Dict[str, Any]: The dict representation of the model
41
-
42
- """
43
- return model.model_dump()
44
-
45
- def model_dump_json(model: BaseModel) -> str:
46
- """Convert a pydantic model to a JSON string
47
-
48
- Args:
49
- model (BaseModel): The model to convert
50
-
51
- Returns:
52
- str: The JSON string representation of the model
53
- """
54
- return model.model_dump_json()
55
-
56
-
57
- # Remove this once we drop support for pydantic 1.x
58
- else: # pragma: no cover
59
- from pydantic import schema_of
60
- from pydantic.typing import evaluate_forwardref as evaluate_forwardref # type: ignore[no-redef]
61
-
62
- JsonSchemaValue = Dict[str, Any] # type: ignore[misc]
63
-
64
- def type2schema(t: Any) -> JsonSchemaValue:
65
- """Convert a type to a JSON schema
66
-
67
- Args:
68
- t (Type): The type to convert
69
-
70
- Returns:
71
- JsonSchemaValue: The JSON schema
72
- """
73
-
74
- if t is None:
75
- return {"type": "null"}
76
- elif get_origin(t) is Union:
77
- return {"anyOf": [type2schema(tt) for tt in get_args(t)]}
78
- elif get_origin(t) in [Tuple, tuple]:
79
- prefixItems = [type2schema(tt) for tt in get_args(t)]
80
- return {
81
- "maxItems": len(prefixItems),
82
- "minItems": len(prefixItems),
83
- "prefixItems": prefixItems,
84
- "type": "array",
85
- }
86
- else:
87
- d = schema_of(t)
88
- if "title" in d:
89
- d.pop("title")
90
- if "description" in d:
91
- d.pop("description")
92
-
93
- return d
94
-
95
- def model_dump(model: BaseModel) -> Dict[str, Any]:
96
- """Convert a pydantic model to a dict
97
-
98
- Args:
99
- model (BaseModel): The model to convert
100
-
101
- Returns:
102
- Dict[str, Any]: The dict representation of the model
103
-
104
- """
105
- return model.dict()
106
-
107
- def model_dump_json(model: BaseModel) -> str:
108
- """Convert a pydantic model to a JSON string
109
-
110
- Args:
111
- model (BaseModel): The model to convert
112
-
113
- Returns:
114
- str: The JSON string representation of the model
115
- """
116
- return model.json()
@@ -1,42 +0,0 @@
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 .agent import Agent
8
- from .assistant_agent import AssistantAgent
9
- from .chat import ChatResult, initiate_chats
10
-
11
- # Imported last to avoid circular imports
12
- from .contrib.swarm_agent import (
13
- AFTER_WORK,
14
- ON_CONDITION,
15
- AfterWorkOption,
16
- SwarmAgent,
17
- SwarmResult,
18
- initiate_swarm_chat,
19
- )
20
- from .conversable_agent import ConversableAgent, register_function
21
- from .groupchat import GroupChat, GroupChatManager
22
- from .user_proxy_agent import UserProxyAgent
23
- from .utils import gather_usage_summary
24
-
25
- __all__ = [
26
- "Agent",
27
- "ConversableAgent",
28
- "AssistantAgent",
29
- "UserProxyAgent",
30
- "GroupChat",
31
- "GroupChatManager",
32
- "register_function",
33
- "initiate_chats",
34
- "gather_usage_summary",
35
- "ChatResult",
36
- "initiate_swarm_chat",
37
- "SwarmAgent",
38
- "SwarmResult",
39
- "ON_CONDITION",
40
- "AFTER_WORK",
41
- "AfterWorkOption",
42
- ]
@@ -1,142 +0,0 @@
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 Any, Dict, List, Optional, Protocol, Union, runtime_checkable
8
-
9
-
10
- @runtime_checkable
11
- class Agent(Protocol):
12
- """(In preview) A protocol for Agent.
13
-
14
- An agent can communicate with other agents and perform actions.
15
- Different agents can differ in what actions they perform in the `receive` method.
16
- """
17
-
18
- @property
19
- def name(self) -> str:
20
- """The name of the agent."""
21
- ...
22
-
23
- @property
24
- def description(self) -> str:
25
- """The description of the agent. Used for the agent's introduction in
26
- a group chat setting."""
27
- ...
28
-
29
- def send(
30
- self,
31
- message: Union[Dict[str, Any], str],
32
- recipient: "Agent",
33
- request_reply: Optional[bool] = None,
34
- ) -> None:
35
- """Send a message to another agent.
36
-
37
- Args:
38
- message (dict or str): the message to send. If a dict, it should be
39
- a JSON-serializable and follows the OpenAI's ChatCompletion schema.
40
- recipient (Agent): the recipient of the message.
41
- request_reply (bool): whether to request a reply from the recipient.
42
- """
43
- ...
44
-
45
- async def a_send(
46
- self,
47
- message: Union[Dict[str, Any], str],
48
- recipient: "Agent",
49
- request_reply: Optional[bool] = None,
50
- ) -> None:
51
- """(Async) Send a message to another agent.
52
-
53
- Args:
54
- message (dict or str): the message to send. If a dict, it should be
55
- a JSON-serializable and follows the OpenAI's ChatCompletion schema.
56
- recipient (Agent): the recipient of the message.
57
- request_reply (bool): whether to request a reply from the recipient.
58
- """
59
- ...
60
-
61
- def receive(
62
- self,
63
- message: Union[Dict[str, Any], str],
64
- sender: "Agent",
65
- request_reply: Optional[bool] = None,
66
- ) -> None:
67
- """Receive a message from another agent.
68
-
69
- Args:
70
- message (dict or str): the message received. If a dict, it should be
71
- a JSON-serializable and follows the OpenAI's ChatCompletion schema.
72
- sender (Agent): the sender of the message.
73
- request_reply (bool): whether the sender requests a reply.
74
- """
75
-
76
- async def a_receive(
77
- self,
78
- message: Union[Dict[str, Any], str],
79
- sender: "Agent",
80
- request_reply: Optional[bool] = None,
81
- ) -> None:
82
- """(Async) Receive a message from another agent.
83
-
84
- Args:
85
- message (dict or str): the message received. If a dict, it should be
86
- a JSON-serializable and follows the OpenAI's ChatCompletion schema.
87
- sender (Agent): the sender of the message.
88
- request_reply (bool): whether the sender requests a reply.
89
- """
90
- ...
91
-
92
- def generate_reply(
93
- self,
94
- messages: Optional[List[Dict[str, Any]]] = None,
95
- sender: Optional["Agent"] = None,
96
- **kwargs: Any,
97
- ) -> Union[str, Dict[str, Any], None]:
98
- """Generate a reply based on the received messages.
99
-
100
- Args:
101
- messages (list[dict]): a list of messages received from other agents.
102
- The messages are dictionaries that are JSON-serializable and
103
- follows the OpenAI's ChatCompletion schema.
104
- sender: sender of an Agent instance.
105
-
106
- Returns:
107
- str or dict or None: the generated reply. If None, no reply is generated.
108
- """
109
-
110
- async def a_generate_reply(
111
- self,
112
- messages: Optional[List[Dict[str, Any]]] = None,
113
- sender: Optional["Agent"] = None,
114
- **kwargs: Any,
115
- ) -> Union[str, Dict[str, Any], None]:
116
- """(Async) Generate a reply based on the received messages.
117
-
118
- Args:
119
- messages (list[dict]): a list of messages received from other agents.
120
- The messages are dictionaries that are JSON-serializable and
121
- follows the OpenAI's ChatCompletion schema.
122
- sender: sender of an Agent instance.
123
-
124
- Returns:
125
- str or dict or None: the generated reply. If None, no reply is generated.
126
- """
127
-
128
-
129
- @runtime_checkable
130
- class LLMAgent(Agent, Protocol):
131
- """(In preview) A protocol for an LLM agent."""
132
-
133
- @property
134
- def system_message(self) -> str:
135
- """The system message of this agent."""
136
-
137
- def update_system_message(self, system_message: str) -> None:
138
- """Update this agent's system message.
139
-
140
- Args:
141
- system_message (str): system message for inference.
142
- """
@@ -1,85 +0,0 @@
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 Callable, Dict, Literal, Optional, Union
8
-
9
- from autogen.runtime_logging import log_new_agent, logging_enabled
10
-
11
- from .conversable_agent import ConversableAgent
12
-
13
-
14
- class AssistantAgent(ConversableAgent):
15
- """(In preview) Assistant agent, designed to solve a task with LLM.
16
-
17
- AssistantAgent is a subclass of ConversableAgent configured with a default system message.
18
- The default system message is designed to solve a task with LLM,
19
- including suggesting python code blocks and debugging.
20
- `human_input_mode` is default to "NEVER"
21
- and `code_execution_config` is default to False.
22
- This agent doesn't execute code by default, and expects the user to execute the code.
23
- """
24
-
25
- DEFAULT_SYSTEM_MESSAGE = """You are a helpful AI assistant.
26
- Solve tasks using your coding and language skills.
27
- In the following cases, suggest python code (in a python coding block) or shell script (in a sh coding block) for the user to execute.
28
- 1. When you need to collect info, use the code to output the info you need, for example, browse or search the web, download/read a file, print the content of a webpage or a file, get the current date/time, check the operating system. After sufficient info is printed and the task is ready to be solved based on your language skill, you can solve the task by yourself.
29
- 2. When you need to perform some task with code, use the code to perform the task and output the result. Finish the task smartly.
30
- Solve the task step by step if you need to. If a plan is not provided, explain your plan first. Be clear which step uses code, and which step uses your language skill.
31
- When using code, you must indicate the script type in the code block. The user cannot provide any other feedback or perform any other action beyond executing the code you suggest. The user can't modify your code. So do not suggest incomplete code which requires users to modify. Don't use a code block if it's not intended to be executed by the user.
32
- If you want the user to save the code in a file before executing it, put # filename: <filename> inside the code block as the first line. Don't include multiple code blocks in one response. Do not ask users to copy and paste the result. Instead, use 'print' function for the output when relevant. Check the execution result returned by the user.
33
- If the result indicates there is an error, fix the error and output the code again. Suggest the full code instead of partial code or code changes. If the error can't be fixed or if the task is not solved even after the code is executed successfully, analyze the problem, revisit your assumption, collect additional info you need, and think of a different approach to try.
34
- When you find an answer, verify the answer carefully. Include verifiable evidence in your response if possible.
35
- Reply "TERMINATE" in the end when everything is done.
36
- """
37
-
38
- DEFAULT_DESCRIPTION = "A helpful and general-purpose AI assistant that has strong language skills, Python skills, and Linux command line skills."
39
-
40
- def __init__(
41
- self,
42
- name: str,
43
- system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE,
44
- llm_config: Optional[Union[Dict, Literal[False]]] = None,
45
- is_termination_msg: Optional[Callable[[Dict], bool]] = None,
46
- max_consecutive_auto_reply: Optional[int] = None,
47
- human_input_mode: Literal["ALWAYS", "NEVER", "TERMINATE"] = "NEVER",
48
- description: Optional[str] = None,
49
- **kwargs,
50
- ):
51
- """
52
- Args:
53
- name (str): agent name.
54
- system_message (str): system message for the ChatCompletion inference.
55
- Please override this attribute if you want to reprogram the agent.
56
- llm_config (dict or False or None): llm inference configuration.
57
- Please refer to [OpenAIWrapper.create](/docs/reference/oai/client#create)
58
- for available options.
59
- is_termination_msg (function): a function that takes a message in the form of a dictionary
60
- and returns a boolean value indicating if this received message is a termination message.
61
- The dict can contain the following keys: "content", "role", "name", "function_call".
62
- max_consecutive_auto_reply (int): the maximum number of consecutive auto replies.
63
- default to None (no limit provided, class attribute MAX_CONSECUTIVE_AUTO_REPLY will be used as the limit in this case).
64
- The limit only plays a role when human_input_mode is not "ALWAYS".
65
- **kwargs (dict): Please refer to other kwargs in
66
- [ConversableAgent](conversable_agent#__init__).
67
- """
68
- super().__init__(
69
- name,
70
- system_message,
71
- is_termination_msg,
72
- max_consecutive_auto_reply,
73
- human_input_mode,
74
- llm_config=llm_config,
75
- description=description,
76
- **kwargs,
77
- )
78
- if logging_enabled():
79
- log_new_agent(self, locals())
80
-
81
- # Update the provided description if None, and we are using the default system_message,
82
- # then use the default description.
83
- if description is None:
84
- if system_message == self.DEFAULT_SYSTEM_MESSAGE:
85
- self.description = self.DEFAULT_DESCRIPTION