camel-ai 0.2.11__tar.gz → 0.2.12__tar.gz

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 camel-ai might be problematic. Click here for more details.

Files changed (272) hide show
  1. {camel_ai-0.2.11 → camel_ai-0.2.12}/PKG-INFO +13 -6
  2. {camel_ai-0.2.11 → camel_ai-0.2.12}/README.md +3 -1
  3. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/__init__.py +1 -1
  4. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/chat_agent.py +13 -1
  5. camel_ai-0.2.12/camel/benchmarks/__init__.py +18 -0
  6. camel_ai-0.2.12/camel/benchmarks/base.py +152 -0
  7. camel_ai-0.2.12/camel/benchmarks/gaia.py +478 -0
  8. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/__init__.py +3 -0
  9. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/ollama_config.py +4 -2
  10. camel_ai-0.2.12/camel/configs/sglang_config.py +71 -0
  11. camel_ai-0.2.12/camel/data_collector/__init__.py +19 -0
  12. camel_ai-0.2.12/camel/data_collector/alpaca_collector.py +127 -0
  13. camel_ai-0.2.12/camel/data_collector/base.py +211 -0
  14. camel_ai-0.2.12/camel/data_collector/sharegpt_collector.py +205 -0
  15. camel_ai-0.2.12/camel/datahubs/__init__.py +23 -0
  16. camel_ai-0.2.12/camel/datahubs/base.py +136 -0
  17. camel_ai-0.2.12/camel/datahubs/huggingface.py +433 -0
  18. camel_ai-0.2.12/camel/datahubs/models.py +22 -0
  19. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/__init__.py +2 -0
  20. camel_ai-0.2.12/camel/interpreters/e2b_interpreter.py +136 -0
  21. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/__init__.py +3 -1
  22. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/base_io.py +41 -41
  23. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/__init__.py +2 -0
  24. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/__init__.py +2 -0
  25. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/anthropic_model.py +14 -4
  26. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/base_model.py +28 -0
  27. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/groq_model.py +1 -1
  28. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/model_factory.py +3 -0
  29. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/ollama_model.py +12 -0
  30. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/openai_model.py +0 -26
  31. camel_ai-0.2.12/camel/models/reward/__init__.py +22 -0
  32. camel_ai-0.2.12/camel/models/reward/base_reward_model.py +58 -0
  33. camel_ai-0.2.12/camel/models/reward/evaluator.py +63 -0
  34. camel_ai-0.2.12/camel/models/reward/nemotron_model.py +112 -0
  35. camel_ai-0.2.12/camel/models/sglang_model.py +225 -0
  36. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/vllm_model.py +1 -1
  37. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/personas/persona_hub.py +2 -2
  38. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/schemas/openai_converter.py +2 -2
  39. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/role_playing_worker.py +2 -2
  40. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/single_agent_worker.py +2 -2
  41. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/workforce.py +3 -3
  42. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/object_storages/amazon_s3.py +2 -2
  43. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/object_storages/azure_blob.py +2 -2
  44. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/object_storages/google_cloud.py +2 -2
  45. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/__init__.py +2 -0
  46. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/code_execution.py +5 -1
  47. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/function_tool.py +41 -0
  48. camel_ai-0.2.12/camel/toolkits/math_toolkit.py +107 -0
  49. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/search_toolkit.py +154 -2
  50. camel_ai-0.2.12/camel/toolkits/stripe_toolkit.py +273 -0
  51. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/types/__init__.py +2 -0
  52. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/types/enums.py +27 -2
  53. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/token_counting.py +22 -10
  54. {camel_ai-0.2.11 → camel_ai-0.2.12}/pyproject.toml +24 -9
  55. camel_ai-0.2.11/camel/toolkits/math_toolkit.py +0 -76
  56. {camel_ai-0.2.11 → camel_ai-0.2.12}/LICENSE +0 -0
  57. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/__init__.py +0 -0
  58. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/base.py +0 -0
  59. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/critic_agent.py +0 -0
  60. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/deductive_reasoner_agent.py +0 -0
  61. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/embodied_agent.py +0 -0
  62. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/knowledge_graph_agent.py +0 -0
  63. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/role_assignment_agent.py +0 -0
  64. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/search_agent.py +0 -0
  65. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/task_agent.py +0 -0
  66. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/tool_agents/__init__.py +0 -0
  67. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/tool_agents/base.py +0 -0
  68. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
  69. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/__init__.py +0 -0
  70. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/discord_app.py +0 -0
  71. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/slack/__init__.py +0 -0
  72. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/slack/models.py +0 -0
  73. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/slack/slack_app.py +0 -0
  74. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/bots/telegram_bot.py +0 -0
  75. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/anthropic_config.py +0 -0
  76. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/base_config.py +0 -0
  77. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/cohere_config.py +0 -0
  78. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/deepseek_config.py +0 -0
  79. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/gemini_config.py +0 -0
  80. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/groq_config.py +0 -0
  81. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/litellm_config.py +0 -0
  82. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/mistral_config.py +0 -0
  83. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/nvidia_config.py +0 -0
  84. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/openai_config.py +0 -0
  85. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/qwen_config.py +0 -0
  86. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/reka_config.py +0 -0
  87. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/samba_config.py +0 -0
  88. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/togetherai_config.py +0 -0
  89. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/vllm_config.py +0 -0
  90. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/yi_config.py +0 -0
  91. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/configs/zhipuai_config.py +0 -0
  92. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/__init__.py +0 -0
  93. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/base.py +0 -0
  94. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/mistral_embedding.py +0 -0
  95. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/openai_compatible_embedding.py +0 -0
  96. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/openai_embedding.py +0 -0
  97. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
  98. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/embeddings/vlm_embedding.py +0 -0
  99. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/generators.py +0 -0
  100. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/human.py +0 -0
  101. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/base.py +0 -0
  102. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/docker_interpreter.py +0 -0
  103. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/internal_python_interpreter.py +0 -0
  104. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/interpreter_error.py +0 -0
  105. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/ipython_interpreter.py +0 -0
  106. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/interpreters/subprocess_interpreter.py +0 -0
  107. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/apify_reader.py +0 -0
  108. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/chunkr_reader.py +0 -0
  109. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/firecrawl_reader.py +0 -0
  110. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/jina_url_reader.py +0 -0
  111. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/loaders/unstructured_io.py +0 -0
  112. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/logger.py +0 -0
  113. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/__init__.py +0 -0
  114. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/agent_memories.py +0 -0
  115. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/base.py +0 -0
  116. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/blocks/__init__.py +0 -0
  117. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/blocks/chat_history_block.py +0 -0
  118. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/blocks/vectordb_block.py +0 -0
  119. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/context_creators/__init__.py +0 -0
  120. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/context_creators/score_based.py +0 -0
  121. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/memories/records.py +0 -0
  122. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/base.py +0 -0
  123. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/__init__.py +0 -0
  124. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/alpaca.py +0 -0
  125. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/conversation_models.py +0 -0
  126. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/sharegpt/__init__.py +0 -0
  127. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
  128. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
  129. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
  130. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/messages/func_message.py +0 -0
  131. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/azure_openai_model.py +0 -0
  132. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/cohere_model.py +0 -0
  133. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/deepseek_model.py +0 -0
  134. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/gemini_model.py +0 -0
  135. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/litellm_model.py +0 -0
  136. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/mistral_model.py +0 -0
  137. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/model_manager.py +0 -0
  138. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/nemotron_model.py +0 -0
  139. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/nvidia_model.py +0 -0
  140. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/openai_audio_models.py +0 -0
  141. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/openai_compatible_model.py +0 -0
  142. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/qwen_model.py +0 -0
  143. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/reka_model.py +0 -0
  144. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/samba_model.py +0 -0
  145. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/stub_model.py +0 -0
  146. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/togetherai_model.py +0 -0
  147. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/yi_model.py +0 -0
  148. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/models/zhipuai_model.py +0 -0
  149. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/personas/__init__.py +0 -0
  150. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/personas/persona.py +0 -0
  151. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/__init__.py +0 -0
  152. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/ai_society.py +0 -0
  153. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/base.py +0 -0
  154. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/code.py +0 -0
  155. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/evaluation.py +0 -0
  156. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/generate_text_embedding_data.py +0 -0
  157. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/image_craft.py +0 -0
  158. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/misalignment.py +0 -0
  159. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/multi_condition_image_craft.py +0 -0
  160. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/object_recognition.py +0 -0
  161. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/persona_hub.py +0 -0
  162. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/prompt_templates.py +0 -0
  163. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/role_description_prompt_template.py +0 -0
  164. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/solution_extraction.py +0 -0
  165. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/task_prompt_template.py +0 -0
  166. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/translation.py +0 -0
  167. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/prompts/video_description_prompt.py +0 -0
  168. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/responses/__init__.py +0 -0
  169. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/responses/agent_responses.py +0 -0
  170. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/__init__.py +0 -0
  171. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/auto_retriever.py +0 -0
  172. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/base.py +0 -0
  173. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/bm25_retriever.py +0 -0
  174. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/cohere_rerank_retriever.py +0 -0
  175. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/retrievers/vector_retriever.py +0 -0
  176. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/__init__.py +0 -0
  177. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/api.py +0 -0
  178. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/base.py +0 -0
  179. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/configs.py +0 -0
  180. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/docker_runtime.py +0 -0
  181. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/llm_guard_runtime.py +0 -0
  182. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/remote_http_runtime.py +0 -0
  183. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/utils/__init__.py +0 -0
  184. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/utils/function_risk_toolkit.py +0 -0
  185. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
  186. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/schemas/__init__.py +0 -0
  187. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/schemas/base.py +0 -0
  188. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/__init__.py +0 -0
  189. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/babyagi_playing.py +0 -0
  190. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/role_playing.py +0 -0
  191. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/__init__.py +0 -0
  192. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/base.py +0 -0
  193. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/prompts.py +0 -0
  194. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/task_channel.py +0 -0
  195. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/utils.py +0 -0
  196. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/societies/workforce/worker.py +0 -0
  197. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/__init__.py +0 -0
  198. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/graph_storages/__init__.py +0 -0
  199. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/graph_storages/base.py +0 -0
  200. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/graph_storages/graph_element.py +0 -0
  201. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/graph_storages/nebula_graph.py +0 -0
  202. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/graph_storages/neo4j_graph.py +0 -0
  203. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/key_value_storages/__init__.py +0 -0
  204. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/key_value_storages/base.py +0 -0
  205. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/key_value_storages/in_memory.py +0 -0
  206. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/key_value_storages/json.py +0 -0
  207. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/key_value_storages/redis.py +0 -0
  208. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/object_storages/__init__.py +0 -0
  209. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/object_storages/base.py +0 -0
  210. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/vectordb_storages/__init__.py +0 -0
  211. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/vectordb_storages/base.py +0 -0
  212. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/vectordb_storages/milvus.py +0 -0
  213. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/storages/vectordb_storages/qdrant.py +0 -0
  214. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/tasks/__init__.py +0 -0
  215. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/tasks/task.py +0 -0
  216. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/tasks/task_prompt.py +0 -0
  217. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/terminators/__init__.py +0 -0
  218. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/terminators/base.py +0 -0
  219. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/terminators/response_terminator.py +0 -0
  220. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/terminators/token_limit_terminator.py +0 -0
  221. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/arxiv_toolkit.py +0 -0
  222. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/ask_news_toolkit.py +0 -0
  223. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/base.py +0 -0
  224. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/dalle_toolkit.py +0 -0
  225. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/data_commons_toolkit.py +0 -0
  226. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/github_toolkit.py +0 -0
  227. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/google_maps_toolkit.py +0 -0
  228. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/google_scholar_toolkit.py +0 -0
  229. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/human_toolkit.py +0 -0
  230. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/linkedin_toolkit.py +0 -0
  231. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/meshy_toolkit.py +0 -0
  232. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/notion_toolkit.py +0 -0
  233. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
  234. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
  235. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
  236. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
  237. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
  238. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
  239. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
  240. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
  241. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
  242. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
  243. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
  244. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
  245. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
  246. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
  247. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
  248. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
  249. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
  250. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/security_config.py +0 -0
  251. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
  252. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
  253. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
  254. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
  255. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
  256. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
  257. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
  258. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/open_api_toolkit.py +0 -0
  259. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/reddit_toolkit.py +0 -0
  260. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/retrieval_toolkit.py +0 -0
  261. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/slack_toolkit.py +0 -0
  262. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/twitter_toolkit.py +0 -0
  263. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/video_toolkit.py +0 -0
  264. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/weather_toolkit.py +0 -0
  265. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/toolkits/whatsapp_toolkit.py +0 -0
  266. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/types/openai_types.py +0 -0
  267. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/types/unified_model_type.py +0 -0
  268. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/__init__.py +0 -0
  269. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/async_func.py +0 -0
  270. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/commons.py +0 -0
  271. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/constants.py +0 -0
  272. {camel_ai-0.2.11 → camel_ai-0.2.12}/camel/utils/response_format.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: camel-ai
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Home-page: https://www.camel-ai.org/
6
6
  License: Apache-2.0
@@ -28,12 +28,12 @@ Provides-Extra: tools
28
28
  Provides-Extra: vector-databases
29
29
  Requires-Dist: PyMuPDF (>=1.22.5,<2.0.0) ; extra == "tools" or extra == "all"
30
30
  Requires-Dist: accelerate (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
31
- Requires-Dist: agentops (>=0.3.6,<0.4.0) ; extra == "tools" or extra == "all"
32
- Requires-Dist: anthropic (>=0.29.0,<0.30.0) ; extra == "model-platforms" or extra == "all"
31
+ Requires-Dist: agentops (>=0.3.21,<0.4.0) ; extra == "tools" or extra == "all"
32
+ Requires-Dist: anthropic (>=0.40.0,<0.41.0) ; extra == "model-platforms" or extra == "all"
33
33
  Requires-Dist: apify_client (>=1.8.1,<2.0.0) ; extra == "tools" or extra == "all"
34
34
  Requires-Dist: arxiv (>=2.1.3,<3.0.0) ; extra == "tools" or extra == "all"
35
35
  Requires-Dist: arxiv2text (>=0.1.14,<0.2.0) ; extra == "tools" or extra == "all"
36
- Requires-Dist: asknews (>=0.7.43,<0.8.0) ; extra == "tools" or extra == "all"
36
+ Requires-Dist: asknews (>=0.7.54,<0.8.0) ; extra == "tools" or extra == "all"
37
37
  Requires-Dist: azure-storage-blob (>=12.21.0,<13.0.0) ; extra == "object-storages" or extra == "all"
38
38
  Requires-Dist: beautifulsoup4 (>=4,<5) ; extra == "tools" or extra == "all"
39
39
  Requires-Dist: botocore (>=1.35.3,<2.0.0) ; extra == "object-storages" or extra == "all"
@@ -49,12 +49,14 @@ Requires-Dist: docker (>=7.1.0,<8.0.0) ; extra == "tools" or extra == "runtime"
49
49
  Requires-Dist: docstring-parser (>=0.15,<0.16)
50
50
  Requires-Dist: docx2txt (>=0.8,<0.9) ; extra == "tools" or extra == "all"
51
51
  Requires-Dist: duckduckgo-search (>=6.2.12,<7.0.0) ; extra == "search-tools" or extra == "tools" or extra == "all"
52
+ Requires-Dist: e2b-code-interpreter (>=1.0.3,<2.0.0) ; extra == "tools" or extra == "all"
52
53
  Requires-Dist: eval-type-backport (==0.2.0)
53
54
  Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0) ; extra == "tools" or extra == "all"
54
55
  Requires-Dist: firecrawl-py (>=1.0.0,<2.0.0) ; extra == "tools" or extra == "all"
55
56
  Requires-Dist: google-cloud-storage (>=2.18.0,<3.0.0) ; extra == "object-storages" or extra == "all"
56
57
  Requires-Dist: google-generativeai (>=0.6.0,<0.7.0) ; extra == "model-platforms" or extra == "all"
57
58
  Requires-Dist: googlemaps (>=4.10.0,<5.0.0) ; extra == "tools" or extra == "all"
59
+ Requires-Dist: httpx (>=0.23.0,<0.27.3)
58
60
  Requires-Dist: imageio[pyav] (>=2.34.2,<3.0.0) ; extra == "tools" or extra == "all"
59
61
  Requires-Dist: ipykernel (>=6.0.0,<7.0.0) ; extra == "tools" or extra == "all"
60
62
  Requires-Dist: jsonschema (>=4,<5)
@@ -86,6 +88,7 @@ Requires-Dist: pymilvus (>=2.4.0,<3.0.0) ; extra == "rag" or extra == "vector-da
86
88
  Requires-Dist: pyowm (>=3.3.0,<4.0.0) ; extra == "tools" or extra == "all"
87
89
  Requires-Dist: pytest (>=7,<8) ; extra == "test"
88
90
  Requires-Dist: pytest-asyncio (>=0.23.0,<0.24.0) ; extra == "test"
91
+ Requires-Dist: pyyaml (>=6.0.2,<7.0.0) ; extra == "tools" or extra == "all"
89
92
  Requires-Dist: qdrant-client (>=1.9.0,<2.0.0) ; extra == "rag" or extra == "vector-databases" or extra == "all"
90
93
  Requires-Dist: rank-bm25 (>=0.2.2,<0.3.0) ; extra == "rag" or extra == "retrievers" or extra == "all"
91
94
  Requires-Dist: redis (>=5.0.6,<6.0.0) ; extra == "kv-stroages" or extra == "all"
@@ -94,13 +97,15 @@ Requires-Dist: requests_oauthlib (>=1.3.1,<2.0.0) ; extra == "tools" or extra ==
94
97
  Requires-Dist: scholarly[tor] (==1.7.11) ; extra == "tools" or extra == "all"
95
98
  Requires-Dist: sentence-transformers (>=3.0.1,<4.0.0) ; extra == "rag" or extra == "encoders" or extra == "all"
96
99
  Requires-Dist: sentencepiece (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
100
+ Requires-Dist: sglang (>=0.4.0,<0.5.0) ; extra == "model-platforms" or extra == "all"
97
101
  Requires-Dist: slack-bolt (>=1.20.1,<2.0.0) ; extra == "tools" or extra == "all"
98
102
  Requires-Dist: slack-sdk (>=3.27.2,<4.0.0) ; extra == "tools" or extra == "all"
99
103
  Requires-Dist: soundfile (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
104
+ Requires-Dist: stripe (>=11.3.0,<12.0.0) ; extra == "tools" or extra == "all"
100
105
  Requires-Dist: tavily-python (>=0.5.0,<0.6.0) ; extra == "search-tools" or extra == "all"
101
106
  Requires-Dist: textblob (>=0.18.0.post0,<0.19.0) ; extra == "tools" or extra == "all"
102
107
  Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
103
- Requires-Dist: torch (==2.1.0) ; (platform_system == "Darwin" and platform_machine != "arm64") and (extra == "huggingface-agent" or extra == "all")
108
+ Requires-Dist: torch (==2.2.1) ; (platform_system == "Darwin" and platform_machine != "arm64") and (extra == "huggingface-agent" or extra == "all")
104
109
  Requires-Dist: torch (>=2,<3) ; (platform_system != "Darwin" or platform_machine == "arm64") and (extra == "huggingface-agent" or extra == "all")
105
110
  Requires-Dist: transformers (>=4,<5) ; extra == "huggingface-agent" or extra == "all"
106
111
  Requires-Dist: unstructured[all-docs] (>=0.14,<0.15) ; extra == "rag" or extra == "tools" or extra == "all"
@@ -257,7 +262,7 @@ conda create --name camel python=3.10
257
262
  conda activate camel
258
263
 
259
264
  # Clone github repo
260
- git clone -b v0.2.11 https://github.com/camel-ai/camel.git
265
+ git clone -b v0.2.12 https://github.com/camel-ai/camel.git
261
266
 
262
267
  # Change directory into project directory
263
268
  cd camel
@@ -434,6 +439,8 @@ Practical guides and tutorials for implementing specific functionalities in CAME
434
439
  | **[Track CAMEL Agents with AgentOps](https://docs.camel-ai.org/cookbooks/agents_tracking.html)** | Tools for tracking and managing agents in operations. |
435
440
  | **[Create A Hackathon Judge Committee with Workforce](https://docs.camel-ai.org/cookbooks/workforce_judge_committee.html)** | Building a team of agents for collaborative judging. |
436
441
  | **[3 Ways to Ingest Data from Websites with Firecrawl](https://docs.camel-ai.org/cookbooks/ingest_data_from_websites_with_Firecrawl.html)** | Explore three methods for extracting and processing data from websites using Firecrawl. |
442
+ | **[Data Deneration with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/sft_data_generation_and_unsloth_finetuning.html)** | Learn how to generate data with CAMEL and fine-tune models effectively with Unsloth. |
443
+ | **[Customer Service Discord Bot with Agentic RAG](https://docs.camel-ai.org/cookbooks/customer_service_Discord_bot_with_agentic_RAG.html)** | Learn how to build a robust customer service bot for Discord using Agentic RAG. |
437
444
 
438
445
  ## Utilize Various LLMs as Backends
439
446
 
@@ -144,7 +144,7 @@ conda create --name camel python=3.10
144
144
  conda activate camel
145
145
 
146
146
  # Clone github repo
147
- git clone -b v0.2.11 https://github.com/camel-ai/camel.git
147
+ git clone -b v0.2.12 https://github.com/camel-ai/camel.git
148
148
 
149
149
  # Change directory into project directory
150
150
  cd camel
@@ -321,6 +321,8 @@ Practical guides and tutorials for implementing specific functionalities in CAME
321
321
  | **[Track CAMEL Agents with AgentOps](https://docs.camel-ai.org/cookbooks/agents_tracking.html)** | Tools for tracking and managing agents in operations. |
322
322
  | **[Create A Hackathon Judge Committee with Workforce](https://docs.camel-ai.org/cookbooks/workforce_judge_committee.html)** | Building a team of agents for collaborative judging. |
323
323
  | **[3 Ways to Ingest Data from Websites with Firecrawl](https://docs.camel-ai.org/cookbooks/ingest_data_from_websites_with_Firecrawl.html)** | Explore three methods for extracting and processing data from websites using Firecrawl. |
324
+ | **[Data Deneration with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/sft_data_generation_and_unsloth_finetuning.html)** | Learn how to generate data with CAMEL and fine-tune models effectively with Unsloth. |
325
+ | **[Customer Service Discord Bot with Agentic RAG](https://docs.camel-ai.org/cookbooks/customer_service_Discord_bot_with_agentic_RAG.html)** | Learn how to build a robust customer service bot for Discord using Agentic RAG. |
324
326
 
325
327
  ## Utilize Various LLMs as Backends
326
328
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  from camel.logger import disable_logging, enable_logging, set_log_level
16
16
 
17
- __version__ = '0.2.11'
17
+ __version__ = '0.2.12'
18
18
 
19
19
  __all__ = [
20
20
  '__version__',
@@ -499,6 +499,13 @@ class ChatAgent(BaseAgent):
499
499
  "the model configuration and in the ChatAgent step."
500
500
  )
501
501
 
502
+ original_model_dict = self.model_backend.model_config_dict
503
+ if response_format and self.model_type in {"gpt-4o", "gpt-4o-mini"}:
504
+ self.model_backend.model_config_dict = original_model_dict.copy()
505
+ self.model_backend.model_config_dict["response_format"] = (
506
+ response_format
507
+ )
508
+
502
509
  if isinstance(input_message, str):
503
510
  input_message = BaseMessage.make_user_message(
504
511
  role_name='User', content=input_message
@@ -632,6 +639,7 @@ class ChatAgent(BaseAgent):
632
639
  try:
633
640
  openai_messages, num_tokens = self.memory.get_context()
634
641
  except RuntimeError as e:
642
+ self.model_backend.model_config_dict = original_model_dict
635
643
  return self._step_token_exceed(
636
644
  e.args[1], tool_call_records, "max_tokens_exceeded"
637
645
  )
@@ -667,6 +675,8 @@ class ChatAgent(BaseAgent):
667
675
  num_tokens,
668
676
  tool_call_request,
669
677
  )
678
+
679
+ self.model_backend.model_config_dict = original_model_dict
670
680
  return ChatAgentResponse(
671
681
  msgs=output_messages,
672
682
  terminated=self.terminated,
@@ -681,6 +691,7 @@ class ChatAgent(BaseAgent):
681
691
  if (
682
692
  response_format is not None
683
693
  and self.model_type.support_native_tool_calling
694
+ and self.model_type not in {"gpt-4o", "gpt-4o-mini"}
684
695
  ):
685
696
  (
686
697
  output_messages,
@@ -711,6 +722,7 @@ class ChatAgent(BaseAgent):
711
722
  "to record the selected message manually."
712
723
  )
713
724
 
725
+ self.model_backend.model_config_dict = original_model_dict
714
726
  return ChatAgentResponse(
715
727
  msgs=output_messages, terminated=self.terminated, info=info
716
728
  )
@@ -930,7 +942,7 @@ class ChatAgent(BaseAgent):
930
942
  )
931
943
 
932
944
  for base_message_item in output_messages:
933
- base_message_item.content = str(tool_call_record.result)
945
+ base_message_item.content = json.dumps(tool_call_record.result)
934
946
 
935
947
  # Recover the original tools
936
948
  self.func_dict = original_func_dict
@@ -0,0 +1,18 @@
1
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
+
15
+ from .base import BaseBenchmark
16
+ from .gaia import DefaultGAIARetriever, GAIABenchmark
17
+
18
+ __all__ = ["BaseBenchmark", "GAIABenchmark", "DefaultGAIARetriever"]
@@ -0,0 +1,152 @@
1
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
+
15
+ import logging
16
+ from abc import ABC, abstractmethod
17
+ from pathlib import Path
18
+ from typing import Any, Dict, List, Literal, Optional
19
+
20
+ from camel.agents import ChatAgent
21
+
22
+ logger = logging.getLogger(__name__)
23
+
24
+
25
+ class BaseBenchmark(ABC):
26
+ r"""Base class for benchmarks.
27
+
28
+ Attributes:
29
+ name (str): Name of the benchmark.
30
+ data_dir (str): Path to the data directory.
31
+ save_to (str): Path to save the results.
32
+ processes (int): Number of processes to use for parallel
33
+ processing. :(default: :obj:`1`)
34
+ """
35
+
36
+ def __init__(
37
+ self, name: str, data_dir: str, save_to: str, processes: int = 1
38
+ ):
39
+ r"""Initialize the benchmark.
40
+
41
+ Args:
42
+ name (str): Name of the benchmark.
43
+ data_dir (str): Path to the data directory.
44
+ save_to (str): Path to save the results.
45
+ processes (int): Number of processes to use for parallel
46
+ processing. :(default: :obj:`1`)
47
+
48
+ """
49
+ self.name = name
50
+ self.data_dir = Path(data_dir)
51
+ self.processes = processes
52
+ self.save_to = save_to
53
+ if not self.data_dir.exists():
54
+ logger.info(
55
+ f"Data directory {data_dir} does not exist. Creating it."
56
+ )
57
+ self.data_dir.mkdir(parents=True, exist_ok=True)
58
+ if not self.data_dir.is_dir():
59
+ raise NotADirectoryError(
60
+ f"Data directory {data_dir} is not a directory"
61
+ )
62
+ self._data: Dict[str, List[Dict[str, Any]]] = dict()
63
+ self._results: List[Dict[str, Any]] = []
64
+
65
+ @abstractmethod
66
+ def download(self) -> "BaseBenchmark":
67
+ r"""Download the benchmark data.
68
+
69
+ Returns:
70
+ BaseBenchmark: The benchmark instance.
71
+ """
72
+ pass
73
+
74
+ @abstractmethod
75
+ def load(self, force_download: bool = False) -> "BaseBenchmark":
76
+ r"""Load the benchmark data.
77
+
78
+ Args:
79
+ force_download (bool): Whether to force download the data.
80
+
81
+ Returns:
82
+ BaseBenchmark: The benchmark instance.
83
+ """
84
+ pass
85
+
86
+ @property
87
+ def train(self) -> List[Dict[str, Any]]:
88
+ r"""Get the training data.
89
+
90
+ Returns:
91
+ List[Dict[str, Any]]: The training data.
92
+ """
93
+ if not self._data:
94
+ logger.info("Data not loaded. Loading data.")
95
+ self.load()
96
+ return self._data["train"]
97
+
98
+ @property
99
+ def valid(self) -> List[Dict[str, Any]]:
100
+ r"""Get the validation data.
101
+
102
+ Returns:
103
+ List[Dict[str, Any]]: The validation data.
104
+ """
105
+ if not self._data:
106
+ logger.info("Data not loaded. Loading data.")
107
+ self.load()
108
+ return self._data["valid"]
109
+
110
+ @property
111
+ def test(self) -> List[Dict[str, Any]]:
112
+ r"""Get the test data.
113
+
114
+ Returns:
115
+ List[Dict[str, Any]]: The test data.
116
+ """
117
+ if not self._data:
118
+ logger.info("Data not loaded. Loading data.")
119
+ self.load()
120
+ return self._data["test"]
121
+
122
+ @abstractmethod
123
+ def run(
124
+ self,
125
+ agent: ChatAgent,
126
+ on: Literal["train", "valid", "test"],
127
+ randomize: bool = False,
128
+ subset: Optional[int] = None,
129
+ *args,
130
+ **kwargs,
131
+ ) -> "BaseBenchmark":
132
+ r"""Run the benchmark.
133
+
134
+ Args:
135
+ agent (ChatAgent): The chat agent.
136
+ on (str): The data split to run the benchmark on.
137
+ randomize (bool): Whether to randomize the data.
138
+ subset (int): The subset of the data to run the benchmark on.
139
+
140
+ Returns:
141
+ BaseBenchmark: The benchmark instance.
142
+ """
143
+ pass
144
+
145
+ @property
146
+ def results(self) -> List[Dict[str, Any]]:
147
+ r"""Get the results.
148
+
149
+ Returns:
150
+ List[Dict[str, Any]]: The results.
151
+ """
152
+ return self._results