camel-ai 0.2.32__tar.gz → 0.2.34__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 (353) hide show
  1. {camel_ai-0.2.32 → camel_ai-0.2.34}/PKG-INFO +3 -6
  2. {camel_ai-0.2.32 → camel_ai-0.2.34}/README.md +2 -2
  3. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/__init__.py +1 -1
  4. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/knowledge_graph_agent.py +5 -0
  5. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datasets/__init__.py +2 -4
  6. camel_ai-0.2.34/camel/datasets/base_generator.py +118 -0
  7. camel_ai-0.2.32/camel/datasets/base_generator.py → camel_ai-0.2.34/camel/datasets/few_shot_generator.py +40 -114
  8. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datasets/static_dataset.py +54 -2
  9. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/openai_compatible_model.py +2 -4
  10. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/sglang_model.py +4 -1
  11. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/file_write_toolkit.py +24 -2
  12. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/github_toolkit.py +15 -3
  13. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/enums.py +16 -0
  14. {camel_ai-0.2.32 → camel_ai-0.2.34}/pyproject.toml +1 -4
  15. {camel_ai-0.2.32 → camel_ai-0.2.34}/.gitignore +0 -0
  16. {camel_ai-0.2.32 → camel_ai-0.2.34}/LICENSE +0 -0
  17. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/__init__.py +0 -0
  18. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/_types.py +0 -0
  19. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/_utils.py +0 -0
  20. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/base.py +0 -0
  21. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/chat_agent.py +0 -0
  22. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/critic_agent.py +0 -0
  23. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/deductive_reasoner_agent.py +0 -0
  24. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/embodied_agent.py +0 -0
  25. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/multi_hop_generator_agent.py +0 -0
  26. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/programmed_agent_instruction.py +0 -0
  27. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/role_assignment_agent.py +0 -0
  28. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/search_agent.py +0 -0
  29. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/task_agent.py +0 -0
  30. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/tool_agents/__init__.py +0 -0
  31. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/tool_agents/base.py +0 -0
  32. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
  33. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/__init__.py +0 -0
  34. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/apibank.py +0 -0
  35. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/apibench.py +0 -0
  36. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/base.py +0 -0
  37. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/gaia.py +0 -0
  38. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/nexus.py +0 -0
  39. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/benchmarks/ragbench.py +0 -0
  40. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/__init__.py +0 -0
  41. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/discord/__init__.py +0 -0
  42. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/discord/discord_app.py +0 -0
  43. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/discord/discord_installation.py +0 -0
  44. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/discord/discord_store.py +0 -0
  45. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/slack/__init__.py +0 -0
  46. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/slack/models.py +0 -0
  47. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/slack/slack_app.py +0 -0
  48. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/bots/telegram_bot.py +0 -0
  49. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/__init__.py +0 -0
  50. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/aiml_config.py +0 -0
  51. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/anthropic_config.py +0 -0
  52. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/base_config.py +0 -0
  53. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/cohere_config.py +0 -0
  54. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/deepseek_config.py +0 -0
  55. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/gemini_config.py +0 -0
  56. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/groq_config.py +0 -0
  57. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/internlm_config.py +0 -0
  58. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/litellm_config.py +0 -0
  59. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/mistral_config.py +0 -0
  60. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/moonshot_config.py +0 -0
  61. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/nvidia_config.py +0 -0
  62. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/ollama_config.py +0 -0
  63. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/openai_config.py +0 -0
  64. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/qwen_config.py +0 -0
  65. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/reka_config.py +0 -0
  66. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/samba_config.py +0 -0
  67. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/sglang_config.py +0 -0
  68. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/siliconflow_config.py +0 -0
  69. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/togetherai_config.py +0 -0
  70. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/vllm_config.py +0 -0
  71. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/yi_config.py +0 -0
  72. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/configs/zhipuai_config.py +0 -0
  73. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/data_collector/__init__.py +0 -0
  74. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/data_collector/alpaca_collector.py +0 -0
  75. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/data_collector/base.py +0 -0
  76. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/data_collector/sharegpt_collector.py +0 -0
  77. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/__init__.py +0 -0
  78. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/cot_datagen.py +0 -0
  79. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_improving_cot.py +0 -0
  80. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/__init__.py +0 -0
  81. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/filter/__init__.py +0 -0
  82. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
  83. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
  84. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
  85. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/self_instruct.py +0 -0
  86. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/self_instruct/templates.py +0 -0
  87. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/source2synth/__init__.py +0 -0
  88. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/source2synth/data_processor.py +0 -0
  89. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/source2synth/models.py +0 -0
  90. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
  91. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datahubs/__init__.py +0 -0
  92. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datahubs/base.py +0 -0
  93. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datahubs/huggingface.py +0 -0
  94. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datahubs/models.py +0 -0
  95. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/datasets/models.py +0 -0
  96. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/__init__.py +0 -0
  97. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/base.py +0 -0
  98. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/jina_embedding.py +0 -0
  99. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/mistral_embedding.py +0 -0
  100. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/openai_compatible_embedding.py +0 -0
  101. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/openai_embedding.py +0 -0
  102. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
  103. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/embeddings/vlm_embedding.py +0 -0
  104. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/environments/__init__.py +0 -0
  105. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/environments/models.py +0 -0
  106. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/environments/multi_step.py +0 -0
  107. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/environments/single_step.py +0 -0
  108. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/extractors/__init__.py +0 -0
  109. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/extractors/base.py +0 -0
  110. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/extractors/python_strategies.py +0 -0
  111. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/generators.py +0 -0
  112. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/human.py +0 -0
  113. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/__init__.py +0 -0
  114. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/base.py +0 -0
  115. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/docker/Dockerfile +0 -0
  116. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/docker_interpreter.py +0 -0
  117. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/e2b_interpreter.py +0 -0
  118. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/internal_python_interpreter.py +0 -0
  119. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/interpreter_error.py +0 -0
  120. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/ipython_interpreter.py +0 -0
  121. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/interpreters/subprocess_interpreter.py +0 -0
  122. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/__init__.py +0 -0
  123. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/apify_reader.py +0 -0
  124. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/base_io.py +0 -0
  125. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/chunkr_reader.py +0 -0
  126. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/firecrawl_reader.py +0 -0
  127. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/jina_url_reader.py +0 -0
  128. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/mineru_extractor.py +0 -0
  129. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/panda_reader.py +0 -0
  130. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/loaders/unstructured_io.py +0 -0
  131. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/logger.py +0 -0
  132. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/__init__.py +0 -0
  133. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/agent_memories.py +0 -0
  134. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/base.py +0 -0
  135. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/blocks/__init__.py +0 -0
  136. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/blocks/chat_history_block.py +0 -0
  137. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/blocks/vectordb_block.py +0 -0
  138. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/context_creators/__init__.py +0 -0
  139. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/context_creators/score_based.py +0 -0
  140. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/memories/records.py +0 -0
  141. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/__init__.py +0 -0
  142. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/base.py +0 -0
  143. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/__init__.py +0 -0
  144. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/alpaca.py +0 -0
  145. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/conversation_models.py +0 -0
  146. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/sharegpt/__init__.py +0 -0
  147. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
  148. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
  149. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
  150. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/messages/func_message.py +0 -0
  151. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/__init__.py +0 -0
  152. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/_utils.py +0 -0
  153. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/aiml_model.py +0 -0
  154. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/anthropic_model.py +0 -0
  155. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/azure_openai_model.py +0 -0
  156. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/base_audio_model.py +0 -0
  157. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/base_model.py +0 -0
  158. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/cohere_model.py +0 -0
  159. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/deepseek_model.py +0 -0
  160. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/fish_audio_model.py +0 -0
  161. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/gemini_model.py +0 -0
  162. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/groq_model.py +0 -0
  163. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/internlm_model.py +0 -0
  164. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/litellm_model.py +0 -0
  165. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/mistral_model.py +0 -0
  166. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/model_factory.py +0 -0
  167. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/model_manager.py +0 -0
  168. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/moonshot_model.py +0 -0
  169. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/nemotron_model.py +0 -0
  170. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/nvidia_model.py +0 -0
  171. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/ollama_model.py +0 -0
  172. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/openai_audio_models.py +0 -0
  173. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/openai_model.py +0 -0
  174. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/qwen_model.py +0 -0
  175. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reka_model.py +0 -0
  176. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reward/__init__.py +0 -0
  177. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reward/base_reward_model.py +0 -0
  178. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reward/evaluator.py +0 -0
  179. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reward/nemotron_model.py +0 -0
  180. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/reward/skywork_model.py +0 -0
  181. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/samba_model.py +0 -0
  182. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/siliconflow_model.py +0 -0
  183. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/stub_model.py +0 -0
  184. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/togetherai_model.py +0 -0
  185. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/vllm_model.py +0 -0
  186. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/volcano_model.py +0 -0
  187. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/yi_model.py +0 -0
  188. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/models/zhipuai_model.py +0 -0
  189. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/personas/__init__.py +0 -0
  190. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/personas/persona.py +0 -0
  191. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/personas/persona_hub.py +0 -0
  192. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/__init__.py +0 -0
  193. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/ai_society.py +0 -0
  194. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/base.py +0 -0
  195. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/code.py +0 -0
  196. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/evaluation.py +0 -0
  197. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/generate_text_embedding_data.py +0 -0
  198. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/image_craft.py +0 -0
  199. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/misalignment.py +0 -0
  200. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/multi_condition_image_craft.py +0 -0
  201. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/object_recognition.py +0 -0
  202. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/persona_hub.py +0 -0
  203. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/prompt_templates.py +0 -0
  204. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/role_description_prompt_template.py +0 -0
  205. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/solution_extraction.py +0 -0
  206. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/task_prompt_template.py +0 -0
  207. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/translation.py +0 -0
  208. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/prompts/video_description_prompt.py +0 -0
  209. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/py.typed +0 -0
  210. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/responses/__init__.py +0 -0
  211. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/responses/agent_responses.py +0 -0
  212. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/__init__.py +0 -0
  213. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/auto_retriever.py +0 -0
  214. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/base.py +0 -0
  215. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/bm25_retriever.py +0 -0
  216. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/cohere_rerank_retriever.py +0 -0
  217. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/hybrid_retrival.py +0 -0
  218. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/retrievers/vector_retriever.py +0 -0
  219. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/__init__.py +0 -0
  220. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/api.py +0 -0
  221. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/base.py +0 -0
  222. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/configs.py +0 -0
  223. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/docker_runtime.py +0 -0
  224. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/llm_guard_runtime.py +0 -0
  225. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/remote_http_runtime.py +0 -0
  226. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/utils/__init__.py +0 -0
  227. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/utils/function_risk_toolkit.py +0 -0
  228. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
  229. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/schemas/__init__.py +0 -0
  230. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/schemas/base.py +0 -0
  231. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/schemas/openai_converter.py +0 -0
  232. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/schemas/outlines_converter.py +0 -0
  233. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/__init__.py +0 -0
  234. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/babyagi_playing.py +0 -0
  235. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/role_playing.py +0 -0
  236. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/__init__.py +0 -0
  237. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/base.py +0 -0
  238. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/prompts.py +0 -0
  239. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/role_playing_worker.py +0 -0
  240. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/single_agent_worker.py +0 -0
  241. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/task_channel.py +0 -0
  242. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/utils.py +0 -0
  243. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/worker.py +0 -0
  244. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/societies/workforce/workforce.py +0 -0
  245. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/__init__.py +0 -0
  246. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/graph_storages/__init__.py +0 -0
  247. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/graph_storages/base.py +0 -0
  248. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/graph_storages/graph_element.py +0 -0
  249. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/graph_storages/nebula_graph.py +0 -0
  250. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/graph_storages/neo4j_graph.py +0 -0
  251. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/key_value_storages/__init__.py +0 -0
  252. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/key_value_storages/base.py +0 -0
  253. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/key_value_storages/in_memory.py +0 -0
  254. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/key_value_storages/json.py +0 -0
  255. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/key_value_storages/redis.py +0 -0
  256. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/object_storages/__init__.py +0 -0
  257. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/object_storages/amazon_s3.py +0 -0
  258. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/object_storages/azure_blob.py +0 -0
  259. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/object_storages/base.py +0 -0
  260. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/object_storages/google_cloud.py +0 -0
  261. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/vectordb_storages/__init__.py +0 -0
  262. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/vectordb_storages/base.py +0 -0
  263. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/vectordb_storages/milvus.py +0 -0
  264. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/storages/vectordb_storages/qdrant.py +0 -0
  265. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/tasks/__init__.py +0 -0
  266. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/tasks/task.py +0 -0
  267. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/tasks/task_prompt.py +0 -0
  268. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/terminators/__init__.py +0 -0
  269. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/terminators/base.py +0 -0
  270. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/terminators/response_terminator.py +0 -0
  271. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/terminators/token_limit_terminator.py +0 -0
  272. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/__init__.py +0 -0
  273. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/arxiv_toolkit.py +0 -0
  274. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/ask_news_toolkit.py +0 -0
  275. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/audio_analysis_toolkit.py +0 -0
  276. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/base.py +0 -0
  277. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/browser_toolkit.py +0 -0
  278. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/code_execution.py +0 -0
  279. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/dalle_toolkit.py +0 -0
  280. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/dappier_toolkit.py +0 -0
  281. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/data_commons_toolkit.py +0 -0
  282. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/excel_toolkit.py +0 -0
  283. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/function_tool.py +0 -0
  284. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/google_maps_toolkit.py +0 -0
  285. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/google_scholar_toolkit.py +0 -0
  286. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/human_toolkit.py +0 -0
  287. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/image_analysis_toolkit.py +0 -0
  288. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/linkedin_toolkit.py +0 -0
  289. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/math_toolkit.py +0 -0
  290. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/mcp_toolkit.py +0 -0
  291. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/meshy_toolkit.py +0 -0
  292. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/mineru_toolkit.py +0 -0
  293. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/networkx_toolkit.py +0 -0
  294. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/notion_toolkit.py +0 -0
  295. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
  296. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
  297. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
  298. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
  299. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
  300. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
  301. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
  302. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
  303. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
  304. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
  305. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
  306. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
  307. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
  308. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
  309. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
  310. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
  311. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
  312. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/security_config.py +0 -0
  313. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
  314. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
  315. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
  316. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
  317. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
  318. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
  319. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
  320. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/open_api_toolkit.py +0 -0
  321. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/openbb_toolkit.py +0 -0
  322. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/page_script.js +0 -0
  323. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/pubmed_toolkit.py +0 -0
  324. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/reddit_toolkit.py +0 -0
  325. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/retrieval_toolkit.py +0 -0
  326. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/search_toolkit.py +0 -0
  327. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
  328. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/slack_toolkit.py +0 -0
  329. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/stripe_toolkit.py +0 -0
  330. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/sympy_toolkit.py +0 -0
  331. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/terminal_toolkit.py +0 -0
  332. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/twitter_toolkit.py +0 -0
  333. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/video_analysis_toolkit.py +0 -0
  334. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/video_download_toolkit.py +0 -0
  335. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/weather_toolkit.py +0 -0
  336. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/whatsapp_toolkit.py +0 -0
  337. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/toolkits/zapier_toolkit.py +0 -0
  338. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/__init__.py +0 -0
  339. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/agents/__init__.py +0 -0
  340. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/agents/tool_calling_record.py +0 -0
  341. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/openai_types.py +0 -0
  342. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/types/unified_model_type.py +0 -0
  343. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/__init__.py +0 -0
  344. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/async_func.py +0 -0
  345. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/commons.py +0 -0
  346. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/constants.py +0 -0
  347. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/deduplication.py +0 -0
  348. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/response_format.py +0 -0
  349. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/utils/token_counting.py +0 -0
  350. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/verifiers/__init__.py +0 -0
  351. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/verifiers/base.py +0 -0
  352. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/verifiers/models.py +0 -0
  353. {camel_ai-0.2.32 → camel_ai-0.2.34}/camel/verifiers/python_verifier.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camel-ai
3
- Version: 0.2.32
3
+ Version: 0.2.34
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Project-URL: Homepage, https://www.camel-ai.org/
6
6
  Project-URL: Repository, https://github.com/camel-ai/camel
@@ -11,14 +11,11 @@ License-File: LICENSE
11
11
  Keywords: ai-societies,artificial-intelligence,communicative-ai,cooperative-ai,deep-learning,large-language-models,multi-agent-systems,natural-language-processing
12
12
  Requires-Python: <3.13,>=3.10
13
13
  Requires-Dist: colorama<0.5,>=0.4.6
14
- Requires-Dist: curl-cffi==0.6.2
15
14
  Requires-Dist: docstring-parser<0.16,>=0.15
16
- Requires-Dist: eval-type-backport==0.2.0
17
15
  Requires-Dist: httpx<1.0.0dev,>=0.28.0
18
16
  Requires-Dist: jsonschema<5,>=4
19
17
  Requires-Dist: numpy~=1.26
20
18
  Requires-Dist: openai<2,>=1.59.7
21
- Requires-Dist: protobuf<6,>=5
22
19
  Requires-Dist: psutil<6,>=5.9.8
23
20
  Requires-Dist: pydantic<2.10,>=1.9
24
21
  Requires-Dist: pyyaml<7,>=6.0.2
@@ -461,7 +458,7 @@ Explore different types of agents, their roles, and their applications.
461
458
 
462
459
  ### Seeking Help
463
460
 
464
- Please reachout to us on [CAMEL discord](https://discord.camel-ai.org/) if you encounter any issue set up CAMEL.
461
+ Please reach out to us on [CAMEL discord](https://discord.camel-ai.org/) if you encounter any issue set up CAMEL.
465
462
 
466
463
  <br>
467
464
 
@@ -535,7 +532,7 @@ We believe that studying these agents on a large scale offers valuable insights
535
532
 
536
533
  <br>
537
534
 
538
- ## Syenthetic Datasets
535
+ ## Synthetic Datasets
539
536
 
540
537
  ### 1. Utilize Various LLMs as Backends
541
538
 
@@ -202,7 +202,7 @@ Explore different types of agents, their roles, and their applications.
202
202
 
203
203
  ### Seeking Help
204
204
 
205
- Please reachout to us on [CAMEL discord](https://discord.camel-ai.org/) if you encounter any issue set up CAMEL.
205
+ Please reach out to us on [CAMEL discord](https://discord.camel-ai.org/) if you encounter any issue set up CAMEL.
206
206
 
207
207
  <br>
208
208
 
@@ -276,7 +276,7 @@ We believe that studying these agents on a large scale offers valuable insights
276
276
 
277
277
  <br>
278
278
 
279
- ## Syenthetic Datasets
279
+ ## Synthetic Datasets
280
280
 
281
281
  ### 1. Utilize Various LLMs as Backends
282
282
 
@@ -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.32'
17
+ __version__ = '0.2.34'
18
18
 
19
19
  __all__ = [
20
20
  '__version__',
@@ -70,6 +70,11 @@ provided Node and Relationship classes.
70
70
  Ensure that the extracted data adheres to the structure defined by the classes.
71
71
  Output the structured data in a format that can be easily validated against
72
72
  the provided code.
73
+ Do not wrap the output in lists or dictionaries, provide the Node and
74
+ Relationship with unique identifiers.
75
+ Strictly follow the format provided in the example output, do not add any
76
+ additional information.
77
+
73
78
 
74
79
  Instructions for you:
75
80
  Read the provided content thoroughly.
@@ -11,10 +11,8 @@
11
11
  # See the License for the specific language governing permissions and
12
12
  # limitations under the License.
13
13
  # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
- from .base_generator import (
15
- BaseGenerator,
16
- FewShotGenerator,
17
- )
14
+ from .base_generator import BaseGenerator
15
+ from .few_shot_generator import FewShotGenerator
18
16
  from .models import DataPoint
19
17
  from .static_dataset import StaticDataset
20
18
 
@@ -0,0 +1,118 @@
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 abc
16
+ import json
17
+ import random
18
+ from pathlib import Path
19
+ from typing import List, Union
20
+
21
+ from camel.logger import get_logger
22
+
23
+ from .models import DataPoint
24
+
25
+ logger = get_logger(__name__)
26
+
27
+
28
+ class BaseGenerator(abc.ABC):
29
+ r"""Abstract base class for data generators.
30
+
31
+ This class defines the interface for generating synthetic datapoints.
32
+ Concrete implementations should provide specific generation strategies.
33
+ """
34
+
35
+ def __init__(self, seed: int = 42, **kwargs):
36
+ r"""Initialize the base generator.
37
+
38
+ Args:
39
+ seed (int): Random seed for reproducibility. (default: :obj:`42`)
40
+ **kwargs: Additional generator parameters.
41
+ """
42
+ self._rng = random.Random(seed)
43
+
44
+ self._data: List[DataPoint] = []
45
+
46
+ @abc.abstractmethod
47
+ async def generate_new(self, n: int, **kwargs) -> List[DataPoint]:
48
+ r"""Generate n new datapoints.
49
+
50
+ Args:
51
+ n (int): Number of datapoints to generate.
52
+ **kwargs: Additional generation parameters.
53
+
54
+ Returns:
55
+ List[DataPoint]: A list of newly generated datapoints.
56
+ """
57
+ pass
58
+
59
+ def __len__(self) -> int:
60
+ r"""Return the size of the generated dataset."""
61
+ return len(self._data)
62
+
63
+ def __getitem__(self, idx: int) -> DataPoint:
64
+ r"""Retrieve a datapoint by index.
65
+
66
+ Args:
67
+ idx (int): Index of the datapoint.
68
+
69
+ Returns:
70
+ DataPoint: The datapoint corresponding to the given index.
71
+
72
+ Raises:
73
+ IndexError: If idx is out of bounds.
74
+ """
75
+ if idx < 0 or idx >= len(self._data):
76
+ raise IndexError(
77
+ f"Index {idx} out of bounds for dataset of "
78
+ f"size {len(self._data)}"
79
+ )
80
+ return self._data[idx]
81
+
82
+ def sample(self) -> DataPoint:
83
+ if len(self._data) == 0:
84
+ raise RuntimeError("Dataset is empty, cannot sample.")
85
+ idx = self._rng.randint(0, len(self._data) - 1)
86
+ return self[idx]
87
+
88
+ def save_to_jsonl(self, file_path: Union[str, Path]) -> None:
89
+ r"""Saves the generated datapoints to a JSONL (JSON Lines) file.
90
+
91
+ Each datapoint is stored as a separate JSON object on a new line.
92
+
93
+ Args:
94
+ file_path (Union[str, Path]): Path to save the JSONL file.
95
+
96
+ Raises:
97
+ ValueError: If no datapoints have been generated.
98
+ IOError: If there is an issue writing to the file.
99
+
100
+ Notes:
101
+ - Uses `self._data`, which contains the generated datapoints.
102
+ - Overwrites the file if it already exists.
103
+ - Ensures compatibility with large datasets by using JSONL format.
104
+ """
105
+ if not self._data:
106
+ raise ValueError("Dataset is empty. No data to save.")
107
+
108
+ file_path = Path(file_path)
109
+
110
+ try:
111
+ with file_path.open("w", encoding="utf-8") as f:
112
+ for datapoint in self._data:
113
+ json.dump(datapoint.to_dict(), f, ensure_ascii=False)
114
+ f.write("\n") # Ensure each entry is on a new line
115
+ logger.info(f"Dataset saved successfully to {file_path}")
116
+ except IOError as e:
117
+ logger.error(f"Error writing to file {file_path}: {e}")
118
+ raise
@@ -12,120 +12,50 @@
12
12
  # limitations under the License.
13
13
  # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
14
 
15
- import abc
16
- import json
17
- import random
15
+ import asyncio
18
16
  from datetime import datetime
19
- from pathlib import Path
20
- from typing import (
21
- List,
22
- Union,
23
- )
17
+ from typing import List
24
18
 
25
19
  from pydantic import ValidationError
26
20
 
27
21
  from camel.agents import ChatAgent
28
22
  from camel.logger import get_logger
23
+ from camel.models.base_model import BaseModelBackend
29
24
  from camel.verifiers import BaseVerifier
30
25
  from camel.verifiers.models import VerifierInput
31
26
 
27
+ from .base_generator import BaseGenerator
32
28
  from .models import DataPoint
33
29
  from .static_dataset import StaticDataset
34
30
 
35
31
  logger = get_logger(__name__)
36
32
 
33
+ SYSTEM_PROMPT = """**You are an advanced data generation assistant.**
34
+ Your goal is to generate high-quality synthetic data points based on
35
+ provided examples. Your output must be well-structured,
36
+ logically sound, and formatted correctly.
37
37
 
38
- class BaseGenerator(abc.ABC):
39
- r"""Abstract base class for data generators.
38
+ **Instructions:**
39
+ 1. **Follow the Structure**
40
+ Each data point must include:
41
+ - **Question**: A clear, well-formed query.
42
+ - **Rationale**: A step-by-step, executable reasoning process ending
43
+ with `print(final_answer)`.
44
+ - **Final Answer**: The correct, concise result.
40
45
 
41
- This class defines the interface for generating synthetic datapoints.
42
- Concrete implementations should provide specific generation strategies.
43
- """
44
-
45
- def __init__(self, seed: int = 42, **kwargs):
46
- r"""Initialize the base generator.
47
-
48
- Args:
49
- seed (int): Random seed for reproducibility. (default: :obj:`42`)
50
- **kwargs: Additional generator parameters.
51
- """
52
- self._rng = random.Random(seed)
53
-
54
- self._data: List[DataPoint] = []
55
-
56
- @abc.abstractmethod
57
- async def generate_new(self, n: int, **kwargs) -> List[DataPoint]:
58
- r"""Generate n new datapoints.
59
-
60
- Args:
61
- n (int): Number of datapoints to generate.
62
- **kwargs: Additional generation parameters.
63
-
64
- Returns:
65
- List[DataPoint]: A list of newly generated datapoints.
66
- """
67
- pass
68
-
69
- def __len__(self) -> int:
70
- r"""Return the size of the generated dataset."""
71
- return len(self._data)
72
-
73
- def __getitem__(self, idx: int) -> DataPoint:
74
- r"""Retrieve a datapoint by index.
75
-
76
- Args:
77
- idx (int): Index of the datapoint.
78
-
79
- Returns:
80
- DataPoint: The datapoint corresponding to the given index.
81
-
82
- Raises:
83
- IndexError: If idx is out of bounds.
84
- """
85
- if idx < 0 or idx >= len(self._data):
86
- raise IndexError(
87
- f"Index {idx} out of bounds for dataset of "
88
- f"size {len(self._data)}"
89
- )
90
- return self._data[idx]
46
+ 2. **Ensure Logical Consistency**
47
+ - The `rationale` must be code that runs correctly.
48
+ - The `final_answer` should match the printed output.
91
49
 
92
- def sample(self) -> DataPoint:
93
- if len(self._data) == 0:
94
- raise RuntimeError("Dataset is empty, cannot sample.")
95
- idx = self._rng.randint(0, len(self._data) - 1)
96
- return self[idx]
50
+ 3. **Output Format (Strict)**
51
+ ```
52
+ Question: [Generated question]
53
+ Rationale: [Code that solves the question, ending in a print statement,
54
+ outputting the answer.]
55
+ Final Answer: [The Final Answer]
97
56
 
98
- def save_to_jsonl(self, file_path: Union[str, Path]) -> None:
99
- r"""Saves the generated datapoints to a JSONL (JSON Lines) file.
100
-
101
- Each datapoint is stored as a separate JSON object on a new line.
102
-
103
- Args:
104
- file_path (Union[str, Path]): Path to save the JSONL file.
105
-
106
- Raises:
107
- ValueError: If no datapoints have been generated.
108
- IOError: If there is an issue writing to the file.
109
-
110
- Notes:
111
- - Uses `self._data`, which contains the generated datapoints.
112
- - Overwrites the file if it already exists.
113
- - Ensures compatibility with large datasets by using JSONL format.
114
- """
115
- if not self._data:
116
- raise ValueError("Dataset is empty. No data to save.")
117
-
118
- file_path = Path(file_path)
119
-
120
- try:
121
- with file_path.open("w", encoding="utf-8") as f:
122
- for datapoint in self._data:
123
- json.dump(datapoint.to_dict(), f, ensure_ascii=False)
124
- f.write("\n") # Ensure each entry is on a new line
125
- logger.info(f"Dataset saved successfully to {file_path}")
126
- except IOError as e:
127
- logger.error(f"Error writing to file {file_path}: {e}")
128
- raise
57
+ **Now, generate a new data point based on the given examples.**
58
+ """
129
59
 
130
60
 
131
61
  class FewShotGenerator(BaseGenerator):
@@ -139,7 +69,7 @@ class FewShotGenerator(BaseGenerator):
139
69
  self,
140
70
  seed_dataset: StaticDataset,
141
71
  verifier: BaseVerifier,
142
- agent: ChatAgent,
72
+ model: BaseModelBackend,
143
73
  seed: int = 42,
144
74
  **kwargs,
145
75
  ):
@@ -149,7 +79,8 @@ class FewShotGenerator(BaseGenerator):
149
79
  seed_dataset (StaticDataset): Validated static dataset to
150
80
  use for examples.
151
81
  verifier (BaseVerifier): Verifier to validate generated content.
152
- agent (ChatAgent): Agent to generate new datapoints.
82
+ model (BaseModelBackend): The underlying LLM that the generating
83
+ agent will be initiated with.
153
84
  seed (int): Random seed for reproducibility. (default: :obj:`42`)
154
85
  **kwargs: Additional generator parameters.
155
86
  """
@@ -160,7 +91,7 @@ class FewShotGenerator(BaseGenerator):
160
91
  except Exception:
161
92
  raise RuntimeError("Seed Data does not follow Datapoint format")
162
93
  self.verifier = verifier
163
- self.agent = agent
94
+ self.agent = ChatAgent(system_message=SYSTEM_PROMPT, model=model)
164
95
 
165
96
  # TODO: Validate that seed dataset contains rationale
166
97
  def _validate_seed_dataset(self) -> None:
@@ -252,18 +183,11 @@ class FewShotGenerator(BaseGenerator):
252
183
  .msgs[0]
253
184
  .parsed
254
185
  )
255
- if not isinstance(agent_output, dict):
256
- raise TypeError("Agent output must be a dictionary")
257
- if "question" not in agent_output:
258
- raise KeyError(
259
- "Missing 'question' in agent"
260
- f"output {agent_output}"
261
- )
262
- if "rationale" not in agent_output:
263
- raise KeyError(
264
- "Missing 'rationale' in agent"
265
- f"output {agent_output}"
266
- )
186
+
187
+ assert isinstance(agent_output, DataPoint)
188
+
189
+ self.agent.reset()
190
+
267
191
  except (TypeError, KeyError) as e:
268
192
  logger.warning(
269
193
  f"Agent output issue: {e}, retrying... "
@@ -272,7 +196,7 @@ class FewShotGenerator(BaseGenerator):
272
196
  retries += 1
273
197
  continue
274
198
 
275
- rationale = agent_output.get("rationale")
199
+ rationale = agent_output.rationale
276
200
 
277
201
  if not isinstance(rationale, str):
278
202
  raise TypeError(f"Rationale {rationale} is not a string.")
@@ -299,7 +223,7 @@ class FewShotGenerator(BaseGenerator):
299
223
 
300
224
  try:
301
225
  new_datapoint = DataPoint(
302
- question=agent_output["question"],
226
+ question=agent_output.question,
303
227
  rationale=rationale,
304
228
  final_answer=verifier_response.result,
305
229
  metadata={
@@ -331,5 +255,7 @@ class FewShotGenerator(BaseGenerator):
331
255
  f"after {max_retries} retries."
332
256
  )
333
257
 
334
- self._data.extend(valid_data_points)
258
+ # Thread-safe way to extend the data list
259
+ async with asyncio.Lock():
260
+ self._data.extend(valid_data_points)
335
261
  return valid_data_points
@@ -60,7 +60,7 @@ class StaticDataset(Dataset):
60
60
  Input data, which can be one of the following:
61
61
  - A Hugging Face Dataset (:obj:`HFDataset`).
62
62
  - A PyTorch Dataset (:obj:`torch.utils.data.Dataset`).
63
- - A :obj:`Path` object representing a JSON file.
63
+ - A :obj:`Path` object representing a JSON or JSONL file.
64
64
  - A list of dictionaries with :obj:`DataPoint`-compatible
65
65
  fields.
66
66
  seed (int): Random seed for reproducibility.
@@ -112,6 +112,7 @@ class StaticDataset(Dataset):
112
112
 
113
113
  Raises:
114
114
  TypeError: If the input data type is unsupported.
115
+ ValueError: If the Path has an unsupported file extension.
115
116
  """
116
117
 
117
118
  if isinstance(data, HFDataset):
@@ -119,7 +120,16 @@ class StaticDataset(Dataset):
119
120
  elif isinstance(data, Dataset):
120
121
  raw_data = self._init_from_pytorch_dataset(data)
121
122
  elif isinstance(data, Path):
122
- raw_data = self._init_from_json_path(data)
123
+ if data.suffix == ".jsonl":
124
+ raw_data = self._init_from_jsonl_path(data)
125
+ elif data.suffix == ".json":
126
+ raw_data = self._init_from_json_path(data)
127
+ else:
128
+ raise ValueError(
129
+ f"Unsupported file extension: {data.suffix}."
130
+ " Please enter a .json or .jsonl object."
131
+ )
132
+
123
133
  elif isinstance(data, list):
124
134
  raw_data = self._init_from_list(data)
125
135
  else:
@@ -322,6 +332,48 @@ class StaticDataset(Dataset):
322
332
  )
323
333
  return loaded_data
324
334
 
335
+ def _init_from_jsonl_path(self, data: Path) -> List[Dict[str, Any]]:
336
+ r"""Load and parse a dataset from a JSONL file.
337
+
338
+ Args:
339
+ data (Path): Path to the JSONL file.
340
+
341
+ Returns:
342
+ List[Dict[str, Any]]: A list of datapoint dictionaries.
343
+
344
+ Raises:
345
+ FileNotFoundError: If the specified JSONL file does not exist.
346
+ ValueError: If a line in the file contains invalid JSON or
347
+ is not a dictionary.
348
+ """
349
+ if not data.exists():
350
+ raise FileNotFoundError(f"JSONL file not found: {data}")
351
+
352
+ raw_data = []
353
+ logger.debug(f"Loading JSONL from {data}")
354
+ with data.open('r', encoding='utf-8') as f:
355
+ for line_number, line in enumerate(f, start=1):
356
+ line = line.strip()
357
+ if not line:
358
+ continue # Skip blank lines if any exist.
359
+ try:
360
+ record = json.loads(line)
361
+ except json.JSONDecodeError as e:
362
+ raise ValueError(
363
+ f"Invalid JSON on line {line_number} in file "
364
+ f"{data}: {e}"
365
+ )
366
+ raw_data.append(record)
367
+ logger.info(f"Successfully loaded {len(raw_data)} items from {data}")
368
+
369
+ for i, item in enumerate(raw_data):
370
+ if not isinstance(item, dict):
371
+ raise ValueError(
372
+ f"Expected a dictionary at record {i+1} (line {i+1}), "
373
+ f"got {type(item).__name__}"
374
+ )
375
+ return raw_data
376
+
325
377
  def _init_from_list(
326
378
  self, data: List[Dict[str, Any]]
327
379
  ) -> List[Dict[str, Any]]:
@@ -56,10 +56,8 @@ class OpenAICompatibleModel(BaseModelBackend):
56
56
  url: Optional[str] = None,
57
57
  token_counter: Optional[BaseTokenCounter] = None,
58
58
  ) -> None:
59
- self.api_key = api_key or os.environ.get(
60
- "OPENAI_COMPATIBILITY_API_KEY"
61
- )
62
- self.url = url or os.environ.get("OPENAI_COMPATIBILITY_API_BASE_URL")
59
+ api_key = api_key or os.environ.get("OPENAI_COMPATIBILITY_API_KEY")
60
+ url = url or os.environ.get("OPENAI_COMPATIBILITY_API_BASE_URL")
63
61
  super().__init__(
64
62
  model_type, model_config_dict, api_key, url, token_counter
65
63
  )
@@ -324,7 +324,10 @@ def _kill_process_tree(
324
324
 
325
325
  # Sometime processes cannot be killed with SIGKILL
326
326
  # so we send an additional signal to kill them.
327
- itself.send_signal(signal.SIGQUIT)
327
+ if hasattr(signal, "SIGQUIT"):
328
+ itself.send_signal(signal.SIGQUIT)
329
+ else:
330
+ itself.send_signal(signal.SIGTERM)
328
331
  except psutil.NoSuchProcess:
329
332
  pass
330
333
 
@@ -13,6 +13,7 @@
13
13
  # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
14
 
15
15
 
16
+ import re
16
17
  from datetime import datetime
17
18
  from pathlib import Path
18
19
  from typing import List, Optional, Union
@@ -69,17 +70,22 @@ class FileWriteToolkit(BaseToolkit):
69
70
  r"""Convert the given string path to a Path object.
70
71
 
71
72
  If the provided path is not absolute, it is made relative to the
72
- default output directory.
73
+ default output directory. The filename part is sanitized to replace
74
+ spaces and special characters with underscores, ensuring safe usage
75
+ in downstream processing.
73
76
 
74
77
  Args:
75
78
  file_path (str): The file path to resolve.
76
79
 
77
80
  Returns:
78
- Path: A fully resolved (absolute) Path object.
81
+ Path: A fully resolved (absolute) and sanitized Path object.
79
82
  """
80
83
  path_obj = Path(file_path)
81
84
  if not path_obj.is_absolute():
82
85
  path_obj = self.output_dir / path_obj
86
+
87
+ sanitized_filename = self._sanitize_filename(path_obj.name)
88
+ path_obj = path_obj.parent / sanitized_filename
83
89
  return path_obj.resolve()
84
90
 
85
91
  def _write_text_file(
@@ -369,3 +375,19 @@ class FileWriteToolkit(BaseToolkit):
369
375
  return [
370
376
  FunctionTool(self.write_to_file),
371
377
  ]
378
+
379
+ def _sanitize_filename(self, filename: str) -> str:
380
+ r"""Sanitize a filename by replacing any character that is not
381
+ alphanumeric, a dot (.), hyphen (-), or underscore (_) with an
382
+ underscore (_).
383
+
384
+ Args:
385
+ filename (str): The original filename which may contain spaces or
386
+ special characters.
387
+
388
+ Returns:
389
+ str: The sanitized filename with disallowed characters replaced by
390
+ underscores.
391
+ """
392
+ safe = re.sub(r'[^\w\-.]', '_', filename)
393
+ return safe
@@ -110,9 +110,21 @@ class GithubToolkit(BaseToolkit):
110
110
  successfully or not.
111
111
  """
112
112
  sb = self.repo.get_branch(self.repo.default_branch)
113
- self.repo.create_git_ref(
114
- ref=f"refs/heads/{branch_name}", sha=sb.commit.sha
115
- )
113
+ from github import GithubException
114
+
115
+ try:
116
+ self.repo.create_git_ref(
117
+ ref=f"refs/heads/{branch_name}", sha=sb.commit.sha
118
+ )
119
+ except GithubException as e:
120
+ if e.message == "Reference already exists":
121
+ # agent might have pushed the branch separately.
122
+ logger.warning(
123
+ f"Branch {branch_name} already exists. "
124
+ "Continuing with the existing branch."
125
+ )
126
+ else:
127
+ raise
116
128
 
117
129
  file = self.repo.get_contents(file_path)
118
130
 
@@ -217,6 +217,14 @@ class ModelType(UnifiedModelType, Enum):
217
217
  def __new__(cls, value) -> "ModelType":
218
218
  return cast("ModelType", UnifiedModelType.__new__(cls, value))
219
219
 
220
+ @classmethod
221
+ def from_name(cls, name):
222
+ r"""Returns the ModelType enum value from a string."""
223
+ for model_type in cls:
224
+ if model_type.value == name:
225
+ return model_type
226
+ raise ValueError(f"Unknown ModelType name: {name}")
227
+
220
228
  @property
221
229
  def value_for_tiktoken(self) -> str:
222
230
  if self.is_openai:
@@ -895,6 +903,14 @@ class ModelPlatformType(Enum):
895
903
  AIML = "aiml"
896
904
  VOLCANO = "volcano"
897
905
 
906
+ @classmethod
907
+ def from_name(cls, name):
908
+ r"""Returns the ModelPlatformType enum value from a string."""
909
+ for model_platfrom_type in cls:
910
+ if model_platfrom_type.value == name:
911
+ return model_platfrom_type
912
+ raise ValueError(f"Unknown ModelPlatformType name: {name}")
913
+
898
914
  @property
899
915
  def is_openai(self) -> bool:
900
916
  r"""Returns whether this platform is openai."""
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "camel-ai"
7
- version = "0.2.32"
7
+ version = "0.2.34"
8
8
  description = "Communicative Agents for AI Society Study"
9
9
  authors = [{ name = "CAMEL-AI.org" }]
10
10
  requires-python = ">=3.10,<3.13"
@@ -26,11 +26,8 @@ dependencies = [
26
26
  "tiktoken>=0.7.0,<0.8",
27
27
  "colorama>=0.4.6,<0.5",
28
28
  "jsonschema>=4,<5",
29
- "protobuf>=5,<6",
30
29
  "docstring-parser>=0.15,<0.16",
31
30
  "pydantic>=1.9,<2.10",
32
- "eval-type-backport==0.2.0",
33
- "curl_cffi==0.6.2",
34
31
  "httpx>=0.28.0,<1.0.0dev",
35
32
  "psutil>=5.9.8,<6",
36
33
  "pyyaml>=6.0.2,<7",