camel-ai 0.2.37__tar.gz → 0.2.38__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.
- {camel_ai-0.2.37 → camel_ai-0.2.38}/PKG-INFO +52 -4
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/__init__.py +1 -1
- camel_ai-0.2.38/camel/datagen/evol_instruct/__init__.py +20 -0
- camel_ai-0.2.38/camel/datagen/evol_instruct/evol_instruct.py +424 -0
- camel_ai-0.2.38/camel/datagen/evol_instruct/scorer.py +166 -0
- camel_ai-0.2.38/camel/datagen/evol_instruct/templates.py +268 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/environments/models.py +10 -4
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/environments/single_step.py +91 -17
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/docker_interpreter.py +1 -1
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/e2b_interpreter.py +1 -1
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/subprocess_interpreter.py +1 -1
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/__init__.py +2 -2
- camel_ai-0.2.37/camel/loaders/panda_reader.py → camel_ai-0.2.38/camel/loaders/pandas_reader.py +61 -30
- camel_ai-0.2.38/camel/memories/context_creators/score_based.py +290 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/aiml_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/anthropic_model.py +11 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/azure_openai_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/base_audio_model.py +6 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/base_model.py +4 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/deepseek_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/gemini_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/groq_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/internlm_model.py +8 -2
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/model_factory.py +4 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/moonshot_model.py +8 -2
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/nemotron_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/nvidia_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/ollama_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/openai_audio_models.py +5 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/openai_compatible_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/openai_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/openrouter_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/qwen_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/samba_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/sglang_model.py +11 -4
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/siliconflow_model.py +8 -2
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/stub_model.py +2 -1
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/togetherai_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/vllm_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/yi_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/zhipuai_model.py +9 -3
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/auto_retriever.py +14 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/__init__.py +2 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/vectordb_storages/__init__.py +2 -0
- camel_ai-0.2.38/camel/storages/vectordb_storages/tidb.py +332 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/__init__.py +5 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/browser_toolkit.py +84 -61
- camel_ai-0.2.38/camel/toolkits/openai_agent_toolkit.py +131 -0
- camel_ai-0.2.38/camel/toolkits/searxng_toolkit.py +207 -0
- camel_ai-0.2.38/camel/toolkits/thinking_toolkit.py +230 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/enums.py +1 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/verifiers/python_verifier.py +12 -4
- {camel_ai-0.2.37 → camel_ai-0.2.38}/pyproject.toml +54 -4
- camel_ai-0.2.37/camel/memories/context_creators/score_based.py +0 -159
- camel_ai-0.2.37/camel/toolkits/thinking_toolkit.py +0 -74
- {camel_ai-0.2.37 → camel_ai-0.2.38}/.gitignore +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/LICENSE +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/README.md +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/_utils.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/repo_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/apibank.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/apibench.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/gaia.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/nexus.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/openrouter_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/sglang_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/data_collector/sharegpt_collector.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datahubs/huggingface.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datasets/base_generator.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datasets/few_shot_generator.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datasets/models.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/datasets/static_dataset.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/environments/multi_step.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/extractors/python_strategies.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/generators.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/human.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/base_io.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/chunkr_reader.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/logger.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/memories/records.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/conversation_models.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/messages/func_message.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/cohere_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/litellm_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/mistral_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reka_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/models/volcano_model.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/personas/persona.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/py.typed +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/api.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/docker_runtime.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/remote_http_runtime.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/graph_storages/neo4j_graph.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/json.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/mem0_cloud.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/key_value_storages/redis.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/audio_analysis_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/dalle_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/excel_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/file_write_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/image_analysis_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/linkedin_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/mcp_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/memory_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/networkx_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/pubmed_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/search_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/slack_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/stripe_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/sympy_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/video_analysis_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/weather_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/toolkits/zapier_toolkit.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/chunker/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/chunker/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/chunker/code_chunker.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/chunker/uio_chunker.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/commons.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/verifiers/base.py +0 -0
- {camel_ai-0.2.37 → camel_ai-0.2.38}/camel/verifiers/models.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.38
|
|
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
|
|
@@ -14,11 +14,9 @@ Requires-Dist: colorama<0.5,>=0.4.6
|
|
|
14
14
|
Requires-Dist: docstring-parser<0.16,>=0.15
|
|
15
15
|
Requires-Dist: httpx<1.0.0dev,>=0.28.0
|
|
16
16
|
Requires-Dist: jsonschema<5,>=4
|
|
17
|
-
Requires-Dist:
|
|
18
|
-
Requires-Dist: openai<2,>=1.59.7
|
|
17
|
+
Requires-Dist: openai<2,>=1.68.0
|
|
19
18
|
Requires-Dist: psutil<6,>=5.9.8
|
|
20
19
|
Requires-Dist: pydantic<2.10,>=1.9
|
|
21
|
-
Requires-Dist: pyyaml<7,>=6.0.2
|
|
22
20
|
Requires-Dist: tiktoken<0.8,>=0.7.0
|
|
23
21
|
Provides-Extra: all
|
|
24
22
|
Requires-Dist: accelerate<0.27,>=0.26.0; extra == 'all'
|
|
@@ -67,6 +65,7 @@ Requires-Dist: neo4j<6,>=5.18.0; extra == 'all'
|
|
|
67
65
|
Requires-Dist: networkx<4,>=3.4.2; extra == 'all'
|
|
68
66
|
Requires-Dist: newspaper3k<0.3,>=0.2.8; extra == 'all'
|
|
69
67
|
Requires-Dist: notion-client<3,>=2.2.1; extra == 'all'
|
|
68
|
+
Requires-Dist: numpy~=1.26; extra == 'all'
|
|
70
69
|
Requires-Dist: openapi-spec-validator<0.8,>=0.7.1; extra == 'all'
|
|
71
70
|
Requires-Dist: opencv-python<5,>=4; extra == 'all'
|
|
72
71
|
Requires-Dist: openpyxl>=3.1.5; extra == 'all'
|
|
@@ -87,6 +86,7 @@ Requires-Dist: pytelegrambotapi<5,>=4.18.0; extra == 'all'
|
|
|
87
86
|
Requires-Dist: pytest-asyncio<0.24,>=0.23.0; extra == 'all'
|
|
88
87
|
Requires-Dist: pytest-cov<5,>=4; extra == 'all'
|
|
89
88
|
Requires-Dist: pytest<8,>=7; extra == 'all'
|
|
89
|
+
Requires-Dist: pytidb-experimental==0.0.1.dev4; extra == 'all'
|
|
90
90
|
Requires-Dist: qdrant-client<2,>=1.9.0; extra == 'all'
|
|
91
91
|
Requires-Dist: rank-bm25<0.3,>=0.2.2; extra == 'all'
|
|
92
92
|
Requires-Dist: redis<6,>=5.0.6; extra == 'all'
|
|
@@ -134,6 +134,7 @@ Requires-Dist: aiosqlite<0.21,>=0.20.0; extra == 'data-tools'
|
|
|
134
134
|
Requires-Dist: datacommons-pandas<0.0.4,>=0.0.3; extra == 'data-tools'
|
|
135
135
|
Requires-Dist: datacommons<2,>=1.4.3; extra == 'data-tools'
|
|
136
136
|
Requires-Dist: networkx<4,>=3.4.2; extra == 'data-tools'
|
|
137
|
+
Requires-Dist: numpy~=1.26; extra == 'data-tools'
|
|
137
138
|
Requires-Dist: pandas<2,>=1.5.3; extra == 'data-tools'
|
|
138
139
|
Requires-Dist: rouge<2,>=1.0.1; extra == 'data-tools'
|
|
139
140
|
Requires-Dist: stripe<12,>=11.3.0; extra == 'data-tools'
|
|
@@ -177,6 +178,7 @@ Requires-Dist: beautifulsoup4<5,>=4; extra == 'document-tools'
|
|
|
177
178
|
Requires-Dist: docx2txt<0.9,>=0.8; extra == 'document-tools'
|
|
178
179
|
Requires-Dist: docx>=0.2.4; extra == 'document-tools'
|
|
179
180
|
Requires-Dist: fpdf>=1.7.2; extra == 'document-tools'
|
|
181
|
+
Requires-Dist: numpy~=1.26; extra == 'document-tools'
|
|
180
182
|
Requires-Dist: openapi-spec-validator<0.8,>=0.7.1; extra == 'document-tools'
|
|
181
183
|
Requires-Dist: openpyxl>=3.1.5; extra == 'document-tools'
|
|
182
184
|
Requires-Dist: pandasai<3,>=2.3.0; extra == 'document-tools'
|
|
@@ -208,12 +210,57 @@ Requires-Dist: fish-audio-sdk<2025,>=2024.12.5; extra == 'model-platforms'
|
|
|
208
210
|
Requires-Dist: litellm<2,>=1.38.1; extra == 'model-platforms'
|
|
209
211
|
Requires-Dist: mistralai<2,>=1.1.0; extra == 'model-platforms'
|
|
210
212
|
Requires-Dist: reka-api<4,>=3.0.8; extra == 'model-platforms'
|
|
213
|
+
Provides-Extra: owl
|
|
214
|
+
Requires-Dist: anthropic<0.50.0,>=0.47.0; extra == 'owl'
|
|
215
|
+
Requires-Dist: beautifulsoup4<5,>=4; extra == 'owl'
|
|
216
|
+
Requires-Dist: chunkr-ai>=0.0.41; extra == 'owl'
|
|
217
|
+
Requires-Dist: datasets<4,>=3; extra == 'owl'
|
|
218
|
+
Requires-Dist: docx2txt<0.9,>=0.8; extra == 'owl'
|
|
219
|
+
Requires-Dist: docx>=0.2.4; extra == 'owl'
|
|
220
|
+
Requires-Dist: duckduckgo-search<7,>=6.3.5; extra == 'owl'
|
|
221
|
+
Requires-Dist: e2b-code-interpreter<2,>=1.0.3; extra == 'owl'
|
|
222
|
+
Requires-Dist: ffmpeg-python<0.3,>=0.2.0; extra == 'owl'
|
|
223
|
+
Requires-Dist: fpdf>=1.7.2; extra == 'owl'
|
|
224
|
+
Requires-Dist: html2text>=2024.2.26; extra == 'owl'
|
|
225
|
+
Requires-Dist: imageio[pyav]<3,>=2.34.2; extra == 'owl'
|
|
226
|
+
Requires-Dist: mcp-server-fetch==2025.1.17; extra == 'owl'
|
|
227
|
+
Requires-Dist: mcp-simple-arxiv==0.2.2; extra == 'owl'
|
|
228
|
+
Requires-Dist: newspaper3k<0.3,>=0.2.8; extra == 'owl'
|
|
229
|
+
Requires-Dist: numpy~=1.26; extra == 'owl'
|
|
230
|
+
Requires-Dist: openapi-spec-validator<0.8,>=0.7.1; extra == 'owl'
|
|
231
|
+
Requires-Dist: opencv-python<5,>=4; extra == 'owl'
|
|
232
|
+
Requires-Dist: openpyxl>=3.1.5; extra == 'owl'
|
|
233
|
+
Requires-Dist: outlines<0.2,>=0.1.7; extra == 'owl'
|
|
234
|
+
Requires-Dist: pandas<2,>=1.5.3; extra == 'owl'
|
|
235
|
+
Requires-Dist: pandasai<3,>=2.3.0; extra == 'owl'
|
|
236
|
+
Requires-Dist: pillow<11.0.0,>=10.1.0; extra == 'owl'
|
|
237
|
+
Requires-Dist: playwright>=1.50.0; extra == 'owl'
|
|
238
|
+
Requires-Dist: prance<24,>=23.6.21.0; extra == 'owl'
|
|
239
|
+
Requires-Dist: pydub<0.26,>=0.25.1; extra == 'owl'
|
|
240
|
+
Requires-Dist: pymupdf<2,>=1.22.5; extra == 'owl'
|
|
241
|
+
Requires-Dist: python-dotenv<2,>=1.0.0; extra == 'owl'
|
|
242
|
+
Requires-Dist: requests-oauthlib<2,>=1.3.1; extra == 'owl'
|
|
243
|
+
Requires-Dist: rouge<2,>=1.0.1; extra == 'owl'
|
|
244
|
+
Requires-Dist: scenedetect>=0.6.5.2; extra == 'owl'
|
|
245
|
+
Requires-Dist: sentencepiece<0.3,>=0.2; extra == 'owl'
|
|
246
|
+
Requires-Dist: soundfile<0.14,>=0.13; extra == 'owl'
|
|
247
|
+
Requires-Dist: tabulate>=0.9.0; extra == 'owl'
|
|
248
|
+
Requires-Dist: transformers<5,>=4; extra == 'owl'
|
|
249
|
+
Requires-Dist: tree-sitter-python<0.24,>=0.23.6; extra == 'owl'
|
|
250
|
+
Requires-Dist: tree-sitter<0.24,>=0.23.2; extra == 'owl'
|
|
251
|
+
Requires-Dist: typer>=0.15.2; extra == 'owl'
|
|
252
|
+
Requires-Dist: unstructured==0.16.20; extra == 'owl'
|
|
253
|
+
Requires-Dist: wikipedia<2,>=1; extra == 'owl'
|
|
254
|
+
Requires-Dist: xls2xlsx>=0.2.0; extra == 'owl'
|
|
255
|
+
Requires-Dist: yt-dlp<2025,>=2024.11.4; extra == 'owl'
|
|
211
256
|
Provides-Extra: rag
|
|
212
257
|
Requires-Dist: cohere<6,>=5.11.0; extra == 'rag'
|
|
213
258
|
Requires-Dist: nebula3-python==3.8.2; extra == 'rag'
|
|
214
259
|
Requires-Dist: neo4j<6,>=5.18.0; extra == 'rag'
|
|
260
|
+
Requires-Dist: numpy~=1.26; extra == 'rag'
|
|
215
261
|
Requires-Dist: pandasai<3,>=2.3.0; extra == 'rag'
|
|
216
262
|
Requires-Dist: pymilvus<3,>=2.4.0; extra == 'rag'
|
|
263
|
+
Requires-Dist: pytidb-experimental==0.0.1.dev4; extra == 'rag'
|
|
217
264
|
Requires-Dist: qdrant-client<2,>=1.9.0; extra == 'rag'
|
|
218
265
|
Requires-Dist: rank-bm25<0.3,>=0.2.2; extra == 'rag'
|
|
219
266
|
Requires-Dist: sentence-transformers<4,>=3.0.1; extra == 'rag'
|
|
@@ -230,6 +277,7 @@ Requires-Dist: mem0ai>=0.1.73; extra == 'storage'
|
|
|
230
277
|
Requires-Dist: nebula3-python==3.8.2; extra == 'storage'
|
|
231
278
|
Requires-Dist: neo4j<6,>=5.18.0; extra == 'storage'
|
|
232
279
|
Requires-Dist: pymilvus<3,>=2.4.0; extra == 'storage'
|
|
280
|
+
Requires-Dist: pytidb-experimental==0.0.1.dev4; extra == 'storage'
|
|
233
281
|
Requires-Dist: qdrant-client<2,>=1.9.0; extra == 'storage'
|
|
234
282
|
Requires-Dist: redis<6,>=5.0.6; extra == 'storage'
|
|
235
283
|
Provides-Extra: test
|
|
@@ -0,0 +1,20 @@
|
|
|
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 .evol_instruct import EvolInstructPipeline
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
'EvolInstructPipeline',
|
|
19
|
+
'MathEvolInstructTemplates',
|
|
20
|
+
]
|
|
@@ -0,0 +1,424 @@
|
|
|
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 random
|
|
16
|
+
import time
|
|
17
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
18
|
+
from math import ceil
|
|
19
|
+
from typing import Any, Dict, List, Optional, Tuple, Type, Union, cast
|
|
20
|
+
|
|
21
|
+
from tqdm import tqdm
|
|
22
|
+
|
|
23
|
+
from camel.agents import ChatAgent
|
|
24
|
+
from camel.datagen.evol_instruct.scorer import BaseScorer, GeneralScorer
|
|
25
|
+
from camel.datagen.evol_instruct.templates import EvolInstructTemplates
|
|
26
|
+
from camel.logger import get_logger
|
|
27
|
+
|
|
28
|
+
logger = get_logger(__name__)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class EvolInstructPipeline:
|
|
32
|
+
r"""Pipeline for evolving prompts using the Evol-Instruct methodology.
|
|
33
|
+
|
|
34
|
+
Supports custom templates defining evolution strategies and methods. The
|
|
35
|
+
pipeline leverages language models to iteratively refine prompts through
|
|
36
|
+
specified evolution strategies.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
templates (Type[EvolInstructTemplates]): Template class containing
|
|
40
|
+
evolution strategy and method definitions. Must provide
|
|
41
|
+
`EVOL_METHODS` and `STRATEGY` attributes.
|
|
42
|
+
(default: :obj:`EvolInstructTemplates`)
|
|
43
|
+
agent (Optional[ChatAgent]): Chat agent instance for LLM interaction.
|
|
44
|
+
If :obj:`None`, initializes with a default ChatAgent.
|
|
45
|
+
(default: :obj:`None`)
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
def __init__(
|
|
49
|
+
self,
|
|
50
|
+
templates: Type = EvolInstructTemplates,
|
|
51
|
+
agent: Optional[ChatAgent] = None,
|
|
52
|
+
) -> None:
|
|
53
|
+
r"""Initialize pipeline with templates and language model agent.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
templates (Type[EvolInstructTemplates]): Template class containing
|
|
57
|
+
evolution strategy configurations.
|
|
58
|
+
(default: :obj:`EvolInstructTemplates`)
|
|
59
|
+
agent (Optional[ChatAgent]): Preconfigured chat agent instance.
|
|
60
|
+
Creates a default ChatAgent if not provided.
|
|
61
|
+
(default: :obj:`None`)
|
|
62
|
+
"""
|
|
63
|
+
self.templates = templates
|
|
64
|
+
self.agent = agent or ChatAgent()
|
|
65
|
+
|
|
66
|
+
def _resolve_evolution_method(self, method_key: str) -> str:
|
|
67
|
+
r"""Resolve evolution method key to concrete implementation.
|
|
68
|
+
|
|
69
|
+
Args:
|
|
70
|
+
method_key (str): Input method identifier. Can be:
|
|
71
|
+
- Direct method key from templates.EVOL_METHODS
|
|
72
|
+
- Strategy name from templates.STRATEGY keys
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
str: Resolved method key from EVOL_METHODS
|
|
76
|
+
"""
|
|
77
|
+
if method_key in self.templates.EVOL_METHODS:
|
|
78
|
+
return method_key
|
|
79
|
+
if method_key.upper() in self.templates.STRATEGY:
|
|
80
|
+
strategy = self.templates.STRATEGY[method_key.upper()]
|
|
81
|
+
strategy_methods = strategy["methods"]
|
|
82
|
+
return random.choice(strategy_methods)
|
|
83
|
+
|
|
84
|
+
logger.warning(
|
|
85
|
+
f"Invalid evolution method: {method_key}. "
|
|
86
|
+
f"Using random selection."
|
|
87
|
+
)
|
|
88
|
+
return random.choice(list(self.templates.EVOL_METHODS))
|
|
89
|
+
|
|
90
|
+
def _get_evolution_methods(
|
|
91
|
+
self,
|
|
92
|
+
method: Union[str, List[str]],
|
|
93
|
+
num_generations: int = 2,
|
|
94
|
+
) -> List[str]:
|
|
95
|
+
r"""Get list of evolution methods based on input specification.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
method (Union[str, List[str]]): Specification for method selection.
|
|
99
|
+
Can be:
|
|
100
|
+
- Strategy name for methods from that strategy
|
|
101
|
+
- Specific method name
|
|
102
|
+
- List of method specifications
|
|
103
|
+
num_generations (int): Number of methods to return.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
List[str]: List of resolved method names
|
|
107
|
+
"""
|
|
108
|
+
candidate_methods = []
|
|
109
|
+
|
|
110
|
+
if isinstance(method, list):
|
|
111
|
+
for method_spec in method:
|
|
112
|
+
candidate_methods.append(
|
|
113
|
+
self._resolve_evolution_method(method_spec)
|
|
114
|
+
)
|
|
115
|
+
elif isinstance(method, str):
|
|
116
|
+
if method.upper() in self.templates.STRATEGY:
|
|
117
|
+
strategy = self.templates.STRATEGY[method.upper()]
|
|
118
|
+
candidate_methods = strategy["methods"]
|
|
119
|
+
else:
|
|
120
|
+
candidate_methods = [self._resolve_evolution_method(method)]
|
|
121
|
+
|
|
122
|
+
# Remove duplicates while preserving order
|
|
123
|
+
unique_candidates = []
|
|
124
|
+
for method_name in candidate_methods:
|
|
125
|
+
if method_name not in unique_candidates:
|
|
126
|
+
unique_candidates.append(method_name)
|
|
127
|
+
|
|
128
|
+
if len(unique_candidates) >= num_generations:
|
|
129
|
+
methods = random.sample(unique_candidates, num_generations)
|
|
130
|
+
else:
|
|
131
|
+
methods = unique_candidates.copy()
|
|
132
|
+
while len(methods) < num_generations:
|
|
133
|
+
methods.append(random.choice(unique_candidates))
|
|
134
|
+
|
|
135
|
+
return methods
|
|
136
|
+
|
|
137
|
+
def _generate_single_evolution(
|
|
138
|
+
self,
|
|
139
|
+
prompt: str,
|
|
140
|
+
method: str,
|
|
141
|
+
return_method: bool = False,
|
|
142
|
+
) -> Tuple[str, str]:
|
|
143
|
+
r"""Generate a single evolved prompt from a seed prompt.
|
|
144
|
+
|
|
145
|
+
Args:
|
|
146
|
+
prompt (str): The seed prompt to evolve.
|
|
147
|
+
method (str): The evolution method key to use.
|
|
148
|
+
return_method (bool): If True, returns method along with prompt.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Tuple[str, str]: Evolved prompt and method
|
|
152
|
+
"""
|
|
153
|
+
resolved_method = self._resolve_evolution_method(method)
|
|
154
|
+
|
|
155
|
+
# Find strategy containing the resolved method
|
|
156
|
+
strategy_key = None
|
|
157
|
+
for strategy, group in self.templates.STRATEGY.items():
|
|
158
|
+
if resolved_method in group["methods"]:
|
|
159
|
+
strategy_key = strategy
|
|
160
|
+
break
|
|
161
|
+
|
|
162
|
+
if strategy_key is None:
|
|
163
|
+
strategy_key = random.choice(list(self.templates.STRATEGY.keys()))
|
|
164
|
+
|
|
165
|
+
strategy = self.templates.STRATEGY[strategy_key]
|
|
166
|
+
instruction_template = strategy["meta_instruction"]
|
|
167
|
+
instruction = instruction_template.format(
|
|
168
|
+
method=self.templates.EVOL_METHODS.get(
|
|
169
|
+
resolved_method,
|
|
170
|
+
random.choice(list(self.templates.EVOL_METHODS.values())),
|
|
171
|
+
),
|
|
172
|
+
prompt=prompt,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
self.agent.reset()
|
|
176
|
+
response = self.agent.step(instruction)
|
|
177
|
+
evolved_prompt = response.msgs[0].content.strip()
|
|
178
|
+
|
|
179
|
+
if return_method:
|
|
180
|
+
return (evolved_prompt, resolved_method)
|
|
181
|
+
else:
|
|
182
|
+
return (evolved_prompt, "")
|
|
183
|
+
|
|
184
|
+
def _generate_multiple_evolutions(
|
|
185
|
+
self,
|
|
186
|
+
prompt: str,
|
|
187
|
+
method: Union[str, List[str]],
|
|
188
|
+
num_generations: int = 2,
|
|
189
|
+
keep_original: bool = True,
|
|
190
|
+
num_threads: int = 10,
|
|
191
|
+
) -> List[Tuple[str, str]]:
|
|
192
|
+
r"""Generate multiple evolved versions of a prompt.
|
|
193
|
+
|
|
194
|
+
Args:
|
|
195
|
+
prompt (str): Seed prompt to evolve.
|
|
196
|
+
method (Union[str, List[str]]): Evolution method specification.
|
|
197
|
+
num_generations (int): Candidates to generate per iteration.
|
|
198
|
+
keep_original (bool): Whether to keep the original prompt.
|
|
199
|
+
num_threads (int): Number of threads for parallel processing.
|
|
200
|
+
|
|
201
|
+
Returns:
|
|
202
|
+
List[Tuple[str, str]]: List of (evolved_prompt, method) pairs
|
|
203
|
+
"""
|
|
204
|
+
results = [(prompt, "original")] if keep_original else []
|
|
205
|
+
|
|
206
|
+
if isinstance(method, list) and len(method) == num_generations:
|
|
207
|
+
candidate_methods = method
|
|
208
|
+
else:
|
|
209
|
+
candidate_methods = self._get_evolution_methods(
|
|
210
|
+
method=method, num_generations=num_generations
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
def _process_single_method(method_name: str) -> Tuple[str, str]:
|
|
214
|
+
return self._generate_single_evolution(
|
|
215
|
+
prompt, method_name, return_method=True
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
with ThreadPoolExecutor(max_workers=num_threads) as executor:
|
|
219
|
+
evolved_results = list(
|
|
220
|
+
executor.map(_process_single_method, candidate_methods)
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
results.extend(evolved_results)
|
|
224
|
+
return results
|
|
225
|
+
|
|
226
|
+
def _generate_iterative_evolutions(
|
|
227
|
+
self,
|
|
228
|
+
prompt: str,
|
|
229
|
+
evolution_spec: Union[str, List[Union[str, List[str]]]],
|
|
230
|
+
num_generations: int = 2,
|
|
231
|
+
num_iterations: Optional[int] = None,
|
|
232
|
+
keep_original: bool = True,
|
|
233
|
+
scorer: Optional[BaseScorer] = None,
|
|
234
|
+
num_threads: int = 10,
|
|
235
|
+
) -> Dict[int, List[Dict[str, Any]]]:
|
|
236
|
+
r"""Generate iterative evolutions of a prompt with scoring.
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
prompt (str): Seed prompt to evolve.
|
|
240
|
+
evolution_spec (Union[str, List[Union[str, List[str]]]]):
|
|
241
|
+
Evolution method specification.
|
|
242
|
+
If a list is provided and num_iterations is None, then
|
|
243
|
+
num_iterations is set to the length of the list.
|
|
244
|
+
num_generations (int): Candidates to generate per iteration.
|
|
245
|
+
num_iterations (Optional[int]): Number of evolution iterations.
|
|
246
|
+
Defaults to the length of evolution_spec.
|
|
247
|
+
keep_original (bool): Include original prompt in results.
|
|
248
|
+
scorer (Optional[BaseScorer]): Scoring model for candidate.
|
|
249
|
+
num_threads (int): Number of threads for parallel processing.
|
|
250
|
+
|
|
251
|
+
Returns:
|
|
252
|
+
Dict[int, List[Dict[str, Any]]]: Evolution results per iteration,
|
|
253
|
+
where each candidate is represented as a dict with keys:
|
|
254
|
+
"instruction", "method", and "scores".
|
|
255
|
+
"""
|
|
256
|
+
if num_iterations is None:
|
|
257
|
+
if isinstance(evolution_spec, list):
|
|
258
|
+
num_iterations = len(evolution_spec)
|
|
259
|
+
else:
|
|
260
|
+
num_iterations = 1
|
|
261
|
+
|
|
262
|
+
results = {}
|
|
263
|
+
current_prompt = prompt
|
|
264
|
+
scorer = scorer or GeneralScorer()
|
|
265
|
+
|
|
266
|
+
for iteration in range(num_iterations):
|
|
267
|
+
if isinstance(evolution_spec, list):
|
|
268
|
+
if iteration < len(evolution_spec):
|
|
269
|
+
iteration_spec = evolution_spec[iteration]
|
|
270
|
+
else:
|
|
271
|
+
iteration_spec = evolution_spec[-1]
|
|
272
|
+
else:
|
|
273
|
+
iteration_spec = evolution_spec
|
|
274
|
+
|
|
275
|
+
batch_results = self._generate_multiple_evolutions(
|
|
276
|
+
prompt=current_prompt,
|
|
277
|
+
method=iteration_spec,
|
|
278
|
+
num_generations=num_generations,
|
|
279
|
+
keep_original=False,
|
|
280
|
+
num_threads=num_threads,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
scored_results = []
|
|
284
|
+
for candidate, method_used in batch_results:
|
|
285
|
+
scores = scorer.score(current_prompt, candidate)
|
|
286
|
+
scored_results.append(
|
|
287
|
+
{
|
|
288
|
+
"instruction": candidate,
|
|
289
|
+
"method": method_used,
|
|
290
|
+
"scores": scores,
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
best_index = max(
|
|
295
|
+
range(len(scored_results)),
|
|
296
|
+
key=lambda i: sum(
|
|
297
|
+
cast(Dict[str, int], scored_results[i]["scores"]).values()
|
|
298
|
+
),
|
|
299
|
+
)
|
|
300
|
+
|
|
301
|
+
best_candidate = cast(
|
|
302
|
+
str, scored_results[best_index]["instruction"]
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
if keep_original:
|
|
306
|
+
results[iteration] = [
|
|
307
|
+
{
|
|
308
|
+
"instruction": current_prompt,
|
|
309
|
+
"method": "original",
|
|
310
|
+
"scores": {},
|
|
311
|
+
},
|
|
312
|
+
*scored_results,
|
|
313
|
+
]
|
|
314
|
+
else:
|
|
315
|
+
results[iteration] = scored_results
|
|
316
|
+
|
|
317
|
+
current_prompt = best_candidate
|
|
318
|
+
|
|
319
|
+
return results
|
|
320
|
+
|
|
321
|
+
def generate(
|
|
322
|
+
self,
|
|
323
|
+
prompts: List[str],
|
|
324
|
+
evolution_spec: Union[str, List[Union[str, List[str]]]],
|
|
325
|
+
num_generations: int = 2,
|
|
326
|
+
num_iterations: Optional[int] = None,
|
|
327
|
+
keep_original: bool = True,
|
|
328
|
+
scorer: Optional[BaseScorer] = None,
|
|
329
|
+
num_chunks: int = 1,
|
|
330
|
+
retry_limit: int = 3,
|
|
331
|
+
retry_delay: float = 1.0,
|
|
332
|
+
num_threads: int = 10,
|
|
333
|
+
) -> List[Dict[int, List[Dict[str, Any]]]]:
|
|
334
|
+
r"""Evolve a batch of prompts through iterative refinement.
|
|
335
|
+
|
|
336
|
+
Args:
|
|
337
|
+
prompts (List[str]): Seed prompts to evolve.
|
|
338
|
+
evolution_spec (Union[str, List[Union[str, List[str]]]]):
|
|
339
|
+
Evolution method specification.
|
|
340
|
+
If a list is provided and num_iterations is None, then
|
|
341
|
+
num_iterations is set to the length of the list.
|
|
342
|
+
num_generations (int): Candidates to generate per iteration.
|
|
343
|
+
num_iterations (Optional[int]): Number of evolution iterations.
|
|
344
|
+
Defaults to the length of evolution_spec.
|
|
345
|
+
keep_original (bool): Include original prompts in results.
|
|
346
|
+
scorer (Optional[BaseScorer]): Scoring model for candidate.
|
|
347
|
+
num_chunks (int): Number of parallel processing chunks.
|
|
348
|
+
retry_limit (int): Max retries for failed generations.
|
|
349
|
+
retry_delay (float): Delay between retries in seconds.
|
|
350
|
+
num_threads (int): Number of threads for parallel processing.
|
|
351
|
+
|
|
352
|
+
Returns:
|
|
353
|
+
List[Dict[int, List[Dict[str, Any]]]]: Evolution results.
|
|
354
|
+
"""
|
|
355
|
+
if num_iterations is None:
|
|
356
|
+
if isinstance(evolution_spec, list):
|
|
357
|
+
num_iterations = len(evolution_spec)
|
|
358
|
+
else:
|
|
359
|
+
num_iterations = 1
|
|
360
|
+
|
|
361
|
+
evolution_plan: List[List[List[str]]] = []
|
|
362
|
+
for _ in prompts:
|
|
363
|
+
prompt_plan = []
|
|
364
|
+
for iteration in range(num_iterations):
|
|
365
|
+
if isinstance(evolution_spec, list):
|
|
366
|
+
if iteration < len(evolution_spec):
|
|
367
|
+
raw_spec = evolution_spec[iteration]
|
|
368
|
+
else:
|
|
369
|
+
raw_spec = evolution_spec[-1]
|
|
370
|
+
else:
|
|
371
|
+
raw_spec = evolution_spec
|
|
372
|
+
prompt_plan.append(
|
|
373
|
+
self._get_evolution_methods(raw_spec, num_generations)
|
|
374
|
+
)
|
|
375
|
+
evolution_plan.append(prompt_plan)
|
|
376
|
+
|
|
377
|
+
def _process_prompt(
|
|
378
|
+
args: Tuple[str, List[List[str]]],
|
|
379
|
+
) -> Dict[int, List[Dict[str, Any]]]:
|
|
380
|
+
prompt, methods = args
|
|
381
|
+
retries = 0
|
|
382
|
+
while retries <= retry_limit:
|
|
383
|
+
try:
|
|
384
|
+
return self._generate_iterative_evolutions(
|
|
385
|
+
prompt=prompt,
|
|
386
|
+
evolution_spec=evolution_spec,
|
|
387
|
+
num_generations=num_generations,
|
|
388
|
+
num_iterations=num_iterations,
|
|
389
|
+
keep_original=keep_original,
|
|
390
|
+
scorer=scorer,
|
|
391
|
+
num_threads=num_threads,
|
|
392
|
+
)
|
|
393
|
+
except Exception as e:
|
|
394
|
+
retries += 1
|
|
395
|
+
if retries <= retry_limit:
|
|
396
|
+
logger.warning(
|
|
397
|
+
f"Error processing prompt "
|
|
398
|
+
f"(attempt {retries}/{retry_limit}): {e!s}"
|
|
399
|
+
)
|
|
400
|
+
time.sleep(retry_delay)
|
|
401
|
+
else:
|
|
402
|
+
logger.error("Failed to process prompt.")
|
|
403
|
+
return {}
|
|
404
|
+
|
|
405
|
+
raise RuntimeError("_process_prompt() did not return.")
|
|
406
|
+
|
|
407
|
+
num_chunks = max(1, min(num_chunks, len(prompts)))
|
|
408
|
+
chunk_size = ceil(len(prompts) / num_chunks)
|
|
409
|
+
results = []
|
|
410
|
+
|
|
411
|
+
for chunk_idx in range(0, len(prompts), chunk_size):
|
|
412
|
+
chunk = prompts[chunk_idx : chunk_idx + chunk_size]
|
|
413
|
+
plan_chunk = evolution_plan[chunk_idx : chunk_idx + chunk_size]
|
|
414
|
+
|
|
415
|
+
with ThreadPoolExecutor(max_workers=num_threads) as executor:
|
|
416
|
+
chunk_results = list(
|
|
417
|
+
tqdm(
|
|
418
|
+
executor.map(_process_prompt, zip(chunk, plan_chunk)),
|
|
419
|
+
total=len(chunk),
|
|
420
|
+
)
|
|
421
|
+
)
|
|
422
|
+
results.extend(chunk_results)
|
|
423
|
+
|
|
424
|
+
return results
|