camel-ai 0.2.44__tar.gz → 0.2.45__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.44 → camel_ai-0.2.45}/PKG-INFO +5 -5
- {camel_ai-0.2.44 → camel_ai-0.2.45}/README.md +4 -4
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/__init__.py +1 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/cohere_model.py +32 -4
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/litellm_model.py +11 -4
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/mistral_model.py +14 -2
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reka_model.py +11 -3
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/volcano_model.py +7 -2
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/__init__.py +2 -0
- camel_ai-0.2.45/camel/runtime/ubuntu_docker_runtime.py +340 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/audio_analysis_toolkit.py +21 -17
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/browser_toolkit.py +2 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/dalle_toolkit.py +15 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/excel_toolkit.py +14 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/image_analysis_toolkit.py +9 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/mcp_toolkit.py +2 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/networkx_toolkit.py +5 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/openai_agent_toolkit.py +5 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/searxng_toolkit.py +7 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/slack_toolkit.py +15 -2
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/video_analysis_toolkit.py +5 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/weather_toolkit.py +14 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/zapier_toolkit.py +6 -2
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/enums.py +9 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/verifiers/base.py +14 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/pyproject.toml +1 -1
- {camel_ai-0.2.44 → camel_ai-0.2.45}/.gitignore +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/LICENSE +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/_utils.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/repo_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/apibank.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/apibench.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/gaia.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/nexus.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/modelscope_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/openrouter_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/ppio_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/sglang_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/data_collector/sharegpt_collector.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/evol_instruct/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/evol_instruct/evol_instruct.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/evol_instruct/scorer.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/evol_instruct/templates.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datahubs/huggingface.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/base_generator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/few_shot_generator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/self_instruct_generator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/datasets/static_dataset.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/azure_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/together_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/environments/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/environments/multi_step.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/environments/single_step.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/environments/tic_tac_toe.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/extractors/python_strategies.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/generators.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/human.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/docker_interpreter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/e2b_interpreter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/interpreters/subprocess_interpreter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/base_io.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/chunkr_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/crawl4ai_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/pandas_reader.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/logger.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/context_creators/score_based.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/memories/records.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/conversation_models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/messages/func_message.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/aiml_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/anthropic_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/azure_openai_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/base_audio_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/base_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/deepseek_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/gemini_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/groq_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/internlm_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/model_factory.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/modelscope_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/moonshot_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/nemotron_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/nvidia_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/ollama_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/openai_audio_models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/openai_compatible_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/openai_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/openrouter_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/ppio_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/qwen_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/samba_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/sglang_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/siliconflow_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/stub_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/togetherai_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/vllm_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/yi_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/models/zhipuai_model.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/personas/persona.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/py.typed +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/auto_retriever.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/api.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/docker_runtime.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/remote_http_runtime.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/graph_storages/neo4j_graph.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/json.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/mem0_cloud.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/key_value_storages/redis.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/vectordb_storages/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/storages/vectordb_storages/tidb.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/file_write_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/google_calendar_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/linkedin_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/memory_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/pubmed_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/search_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/stripe_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/sympy_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/thinking_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/chunker/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/chunker/base.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/chunker/code_chunker.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/chunker/uio_chunker.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/commons.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/mcp.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/verifiers/math_verifier.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/camel/verifiers/models.py +0 -0
- {camel_ai-0.2.44 → camel_ai-0.2.45}/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.
|
|
3
|
+
Version: 0.2.45
|
|
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
|
|
@@ -693,10 +693,10 @@ Practical guides and tutorials for implementing specific functionalities in CAME
|
|
|
693
693
|
### 3. Model Training & Data Generation
|
|
694
694
|
| Cookbook | Description |
|
|
695
695
|
|:---|:---|
|
|
696
|
-
| **[Data Generation with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/
|
|
697
|
-
| **[Data Gen with Real Function Calls and Hermes Format](https://docs.camel-ai.org/cookbooks/
|
|
698
|
-
| **[CoT Data Generation and Upload Data to Huggingface](https://docs.camel-ai.org/cookbooks/
|
|
699
|
-
| **[CoT Data Generation and SFT Qwen with Unsolth](https://docs.camel-ai.org/cookbooks/
|
|
696
|
+
| **[Data Generation with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_Qwen2_5_7B.html)** | Learn how to generate data with CAMEL and fine-tune models effectively with Unsloth. |
|
|
697
|
+
| **[Data Gen with Real Function Calls and Hermes Format](https://docs.camel-ai.org/cookbooks/data_generation/data_gen_with_real_function_calls_and_hermes_format.html)** | Explore how to generate data with real function calls and the Hermes format. |
|
|
698
|
+
| **[CoT Data Generation and Upload Data to Huggingface](https://docs.camel-ai.org/cookbooks/data_generation/distill_math_reasoning_data_from_deepseek_r1.html)** | Uncover how to generate CoT data with CAMEL and seamlessly upload it to Huggingface. |
|
|
699
|
+
| **[CoT Data Generation and SFT Qwen with Unsolth](https://docs.camel-ai.org/cookbooks/data_generation/cot_data_gen_sft_qwen_unsolth_upload_huggingface.html)** | Discover how to generate CoT data using CAMEL and SFT Qwen with Unsolth, and seamlessly upload your data and model to Huggingface. |
|
|
700
700
|
|
|
701
701
|
### 4. Multi-Agent Systems & Applications
|
|
702
702
|
| Cookbook | Description |
|
|
@@ -372,10 +372,10 @@ Practical guides and tutorials for implementing specific functionalities in CAME
|
|
|
372
372
|
### 3. Model Training & Data Generation
|
|
373
373
|
| Cookbook | Description |
|
|
374
374
|
|:---|:---|
|
|
375
|
-
| **[Data Generation with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/
|
|
376
|
-
| **[Data Gen with Real Function Calls and Hermes Format](https://docs.camel-ai.org/cookbooks/
|
|
377
|
-
| **[CoT Data Generation and Upload Data to Huggingface](https://docs.camel-ai.org/cookbooks/
|
|
378
|
-
| **[CoT Data Generation and SFT Qwen with Unsolth](https://docs.camel-ai.org/cookbooks/
|
|
375
|
+
| **[Data Generation with CAMEL and Finetuning with Unsloth](https://docs.camel-ai.org/cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_Qwen2_5_7B.html)** | Learn how to generate data with CAMEL and fine-tune models effectively with Unsloth. |
|
|
376
|
+
| **[Data Gen with Real Function Calls and Hermes Format](https://docs.camel-ai.org/cookbooks/data_generation/data_gen_with_real_function_calls_and_hermes_format.html)** | Explore how to generate data with real function calls and the Hermes format. |
|
|
377
|
+
| **[CoT Data Generation and Upload Data to Huggingface](https://docs.camel-ai.org/cookbooks/data_generation/distill_math_reasoning_data_from_deepseek_r1.html)** | Uncover how to generate CoT data with CAMEL and seamlessly upload it to Huggingface. |
|
|
378
|
+
| **[CoT Data Generation and SFT Qwen with Unsolth](https://docs.camel-ai.org/cookbooks/data_generation/cot_data_gen_sft_qwen_unsolth_upload_huggingface.html)** | Discover how to generate CoT data using CAMEL and SFT Qwen with Unsolth, and seamlessly upload your data and model to Huggingface. |
|
|
379
379
|
|
|
380
380
|
### 4. Multi-Agent Systems & Applications
|
|
381
381
|
| Cookbook | Description |
|
|
@@ -44,7 +44,28 @@ except (ImportError, AttributeError):
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class CohereModel(BaseModelBackend):
|
|
47
|
-
r"""Cohere API in a unified BaseModelBackend interface.
|
|
47
|
+
r"""Cohere API in a unified BaseModelBackend interface.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
model_type (Union[ModelType, str]): Model for which a backend is
|
|
51
|
+
created, one of Cohere series.
|
|
52
|
+
model_config_dict (Optional[Dict[str, Any]], optional): A dictionary
|
|
53
|
+
that will be fed into:obj:`cohere.ClientV2().chat()`. If
|
|
54
|
+
:obj:`None`, :obj:`CohereConfig().as_dict()` will be used.
|
|
55
|
+
(default: :obj:`None`)
|
|
56
|
+
api_key (Optional[str], optional): The API key for authenticating with
|
|
57
|
+
the Cohere service. (default: :obj:`None`)
|
|
58
|
+
url (Optional[str], optional): The url to the Cohere service.
|
|
59
|
+
(default: :obj:`None`)
|
|
60
|
+
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
61
|
+
use for the model. If not provided, :obj:`OpenAITokenCounter(
|
|
62
|
+
ModelType.GPT_4O_MINI)` will be used.
|
|
63
|
+
(default: :obj:`None`)
|
|
64
|
+
timeout (Optional[float], optional): The timeout value in seconds for
|
|
65
|
+
API calls. If not provided, will fall back to the MODEL_TIMEOUT
|
|
66
|
+
environment variable or default to 180 seconds.
|
|
67
|
+
(default: :obj:`None`)
|
|
68
|
+
"""
|
|
48
69
|
|
|
49
70
|
@api_keys_required(
|
|
50
71
|
[
|
|
@@ -58,6 +79,7 @@ class CohereModel(BaseModelBackend):
|
|
|
58
79
|
api_key: Optional[str] = None,
|
|
59
80
|
url: Optional[str] = None,
|
|
60
81
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
82
|
+
timeout: Optional[float] = None,
|
|
61
83
|
):
|
|
62
84
|
import cohere
|
|
63
85
|
|
|
@@ -66,11 +88,17 @@ class CohereModel(BaseModelBackend):
|
|
|
66
88
|
|
|
67
89
|
api_key = api_key or os.environ.get("COHERE_API_KEY")
|
|
68
90
|
url = url or os.environ.get("COHERE_API_BASE_URL")
|
|
91
|
+
|
|
92
|
+
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
69
93
|
super().__init__(
|
|
70
|
-
model_type, model_config_dict, api_key, url, token_counter
|
|
94
|
+
model_type, model_config_dict, api_key, url, token_counter, timeout
|
|
95
|
+
)
|
|
96
|
+
self._client = cohere.ClientV2(
|
|
97
|
+
timeout=self._timeout, api_key=self._api_key
|
|
98
|
+
)
|
|
99
|
+
self._async_client = cohere.AsyncClientV2(
|
|
100
|
+
timeout=self._timeout, api_key=self._api_key
|
|
71
101
|
)
|
|
72
|
-
self._client = cohere.ClientV2(api_key=self._api_key)
|
|
73
|
-
self._async_client = cohere.AsyncClientV2(api_key=self._api_key)
|
|
74
102
|
|
|
75
103
|
def _to_openai_response(self, response: 'ChatResponse') -> ChatCompletion:
|
|
76
104
|
if response.usage and response.usage.tokens:
|
|
@@ -11,6 +11,7 @@
|
|
|
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
|
+
import os
|
|
14
15
|
from typing import Any, Dict, List, Optional, Type, Union
|
|
15
16
|
|
|
16
17
|
from pydantic import BaseModel
|
|
@@ -33,8 +34,8 @@ class LiteLLMModel(BaseModelBackend):
|
|
|
33
34
|
model_type (Union[ModelType, str]): Model for which a backend is
|
|
34
35
|
created, such as GPT-3.5-turbo, Claude-2, etc.
|
|
35
36
|
model_config_dict (Optional[Dict[str, Any]], optional): A dictionary
|
|
36
|
-
that will be fed into:obj:`
|
|
37
|
-
|
|
37
|
+
that will be fed into:obj:`completion()`. If:obj:`None`,
|
|
38
|
+
:obj:`LiteLLMConfig().as_dict()` will be used.
|
|
38
39
|
(default: :obj:`None`)
|
|
39
40
|
api_key (Optional[str], optional): The API key for authenticating with
|
|
40
41
|
the model service. (default: :obj:`None`)
|
|
@@ -43,6 +44,10 @@ class LiteLLMModel(BaseModelBackend):
|
|
|
43
44
|
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
44
45
|
use for the model. If not provided, :obj:`LiteLLMTokenCounter` will
|
|
45
46
|
be used. (default: :obj:`None`)
|
|
47
|
+
timeout (Optional[float], optional): The timeout value in seconds for
|
|
48
|
+
API calls. If not provided, will fall back to the MODEL_TIMEOUT
|
|
49
|
+
environment variable or default to 180 seconds.
|
|
50
|
+
(default: :obj:`None`)
|
|
46
51
|
"""
|
|
47
52
|
|
|
48
53
|
# NOTE: Currently stream mode is not supported.
|
|
@@ -55,14 +60,15 @@ class LiteLLMModel(BaseModelBackend):
|
|
|
55
60
|
api_key: Optional[str] = None,
|
|
56
61
|
url: Optional[str] = None,
|
|
57
62
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
63
|
+
timeout: Optional[float] = None,
|
|
58
64
|
) -> None:
|
|
59
65
|
from litellm import completion
|
|
60
66
|
|
|
61
67
|
if model_config_dict is None:
|
|
62
68
|
model_config_dict = LiteLLMConfig().as_dict()
|
|
63
|
-
|
|
69
|
+
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
64
70
|
super().__init__(
|
|
65
|
-
model_type, model_config_dict, api_key, url, token_counter
|
|
71
|
+
model_type, model_config_dict, api_key, url, token_counter, timeout
|
|
66
72
|
)
|
|
67
73
|
self.client = completion
|
|
68
74
|
|
|
@@ -127,6 +133,7 @@ class LiteLLMModel(BaseModelBackend):
|
|
|
127
133
|
ChatCompletion
|
|
128
134
|
"""
|
|
129
135
|
response = self.client(
|
|
136
|
+
timeout=self._timeout,
|
|
130
137
|
api_key=self._api_key,
|
|
131
138
|
base_url=self._url,
|
|
132
139
|
model=self.model_type,
|
|
@@ -62,6 +62,10 @@ class MistralModel(BaseModelBackend):
|
|
|
62
62
|
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
63
63
|
use for the model. If not provided, :obj:`OpenAITokenCounter` will
|
|
64
64
|
be used. (default: :obj:`None`)
|
|
65
|
+
timeout (Optional[float], optional): The timeout value in seconds for
|
|
66
|
+
API calls. If not provided, will fall back to the MODEL_TIMEOUT
|
|
67
|
+
environment variable or default to 180 seconds.
|
|
68
|
+
(default: :obj:`None`)
|
|
65
69
|
"""
|
|
66
70
|
|
|
67
71
|
@api_keys_required(
|
|
@@ -77,6 +81,7 @@ class MistralModel(BaseModelBackend):
|
|
|
77
81
|
api_key: Optional[str] = None,
|
|
78
82
|
url: Optional[str] = None,
|
|
79
83
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
84
|
+
timeout: Optional[float] = None,
|
|
80
85
|
) -> None:
|
|
81
86
|
from mistralai import Mistral
|
|
82
87
|
|
|
@@ -85,10 +90,17 @@ class MistralModel(BaseModelBackend):
|
|
|
85
90
|
|
|
86
91
|
api_key = api_key or os.environ.get("MISTRAL_API_KEY")
|
|
87
92
|
url = url or os.environ.get("MISTRAL_API_BASE_URL")
|
|
93
|
+
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
88
94
|
super().__init__(
|
|
89
|
-
model_type, model_config_dict, api_key, url, token_counter
|
|
95
|
+
model_type, model_config_dict, api_key, url, token_counter, timeout
|
|
96
|
+
)
|
|
97
|
+
self._client = Mistral(
|
|
98
|
+
timeout_ms=int(self._timeout)
|
|
99
|
+
if self._timeout is not None
|
|
100
|
+
else None,
|
|
101
|
+
api_key=self._api_key,
|
|
102
|
+
server_url=self._url,
|
|
90
103
|
)
|
|
91
|
-
self._client = Mistral(api_key=self._api_key, server_url=self._url)
|
|
92
104
|
|
|
93
105
|
def _to_openai_response(
|
|
94
106
|
self, response: 'ChatCompletionResponse'
|
|
@@ -56,6 +56,10 @@ class RekaModel(BaseModelBackend):
|
|
|
56
56
|
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
57
57
|
use for the model. If not provided, :obj:`OpenAITokenCounter` will
|
|
58
58
|
be used. (default: :obj:`None`)
|
|
59
|
+
timeout (Optional[float], optional): The timeout value in seconds for
|
|
60
|
+
API calls. If not provided, will fall back to the MODEL_TIMEOUT
|
|
61
|
+
environment variable or default to 180 seconds.
|
|
62
|
+
(default: :obj:`None`)
|
|
59
63
|
"""
|
|
60
64
|
|
|
61
65
|
@api_keys_required(
|
|
@@ -71,6 +75,7 @@ class RekaModel(BaseModelBackend):
|
|
|
71
75
|
api_key: Optional[str] = None,
|
|
72
76
|
url: Optional[str] = None,
|
|
73
77
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
78
|
+
timeout: Optional[float] = None,
|
|
74
79
|
) -> None:
|
|
75
80
|
from reka.client import AsyncReka, Reka
|
|
76
81
|
|
|
@@ -78,12 +83,15 @@ class RekaModel(BaseModelBackend):
|
|
|
78
83
|
model_config_dict = RekaConfig().as_dict()
|
|
79
84
|
api_key = api_key or os.environ.get("REKA_API_KEY")
|
|
80
85
|
url = url or os.environ.get("REKA_API_BASE_URL")
|
|
86
|
+
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
81
87
|
super().__init__(
|
|
82
|
-
model_type, model_config_dict, api_key, url, token_counter
|
|
88
|
+
model_type, model_config_dict, api_key, url, token_counter, timeout
|
|
89
|
+
)
|
|
90
|
+
self._client = Reka(
|
|
91
|
+
api_key=self._api_key, base_url=self._url, timeout=self._timeout
|
|
83
92
|
)
|
|
84
|
-
self._client = Reka(api_key=self._api_key, base_url=self._url)
|
|
85
93
|
self._async_client = AsyncReka(
|
|
86
|
-
api_key=self._api_key, base_url=self._url
|
|
94
|
+
api_key=self._api_key, base_url=self._url, timeout=self._timeout
|
|
87
95
|
)
|
|
88
96
|
|
|
89
97
|
def _convert_reka_to_openai_response(
|
|
@@ -41,6 +41,10 @@ class VolcanoModel(OpenAICompatibleModel):
|
|
|
41
41
|
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
42
42
|
use for the model. If not provided, :obj:`OpenAITokenCounter`
|
|
43
43
|
will be used. (default: :obj:`None`)
|
|
44
|
+
timeout (Optional[float], optional): The timeout value in seconds for
|
|
45
|
+
API calls. If not provided, will fall back to the MODEL_TIMEOUT
|
|
46
|
+
environment variable or default to 180 seconds.
|
|
47
|
+
(default: :obj:`None`)
|
|
44
48
|
"""
|
|
45
49
|
|
|
46
50
|
@api_keys_required(
|
|
@@ -55,6 +59,7 @@ class VolcanoModel(OpenAICompatibleModel):
|
|
|
55
59
|
api_key: Optional[str] = None,
|
|
56
60
|
url: Optional[str] = None,
|
|
57
61
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
62
|
+
timeout: Optional[float] = None,
|
|
58
63
|
) -> None:
|
|
59
64
|
if model_config_dict is None:
|
|
60
65
|
model_config_dict = {}
|
|
@@ -65,9 +70,9 @@ class VolcanoModel(OpenAICompatibleModel):
|
|
|
65
70
|
or os.environ.get("VOLCANO_API_BASE_URL")
|
|
66
71
|
or "https://ark.cn-beijing.volces.com/api/v3"
|
|
67
72
|
)
|
|
68
|
-
|
|
73
|
+
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
69
74
|
super().__init__(
|
|
70
|
-
model_type, model_config_dict, api_key, url, token_counter
|
|
75
|
+
model_type, model_config_dict, api_key, url, token_counter, timeout
|
|
71
76
|
)
|
|
72
77
|
|
|
73
78
|
@property
|
|
@@ -16,6 +16,7 @@ from .configs import TaskConfig
|
|
|
16
16
|
from .docker_runtime import DockerRuntime
|
|
17
17
|
from .llm_guard_runtime import LLMGuardRuntime
|
|
18
18
|
from .remote_http_runtime import RemoteHttpRuntime
|
|
19
|
+
from .ubuntu_docker_runtime import UbuntuDockerRuntime
|
|
19
20
|
|
|
20
21
|
# TODO: Add Celery Runtime to support distributed computing,
|
|
21
22
|
# Rate Limiting, Load Balancing, etc.
|
|
@@ -26,4 +27,5 @@ __all__ = [
|
|
|
26
27
|
"RemoteHttpRuntime",
|
|
27
28
|
"LLMGuardRuntime",
|
|
28
29
|
"TaskConfig",
|
|
30
|
+
"UbuntuDockerRuntime",
|
|
29
31
|
]
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
# you may not use this file except in compliance with the License.
|
|
4
|
+
# You may obtain a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
# See the License for the specific language governing permissions and
|
|
12
|
+
# limitations under the License.
|
|
13
|
+
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
|
+
|
|
15
|
+
import logging
|
|
16
|
+
import sys
|
|
17
|
+
import time
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
from typing import Callable, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from camel.runtime.docker_runtime import DockerRuntime
|
|
22
|
+
from camel.toolkits import FunctionTool
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class UbuntuDockerRuntime(DockerRuntime):
|
|
28
|
+
r"""A specialized Docker runtime for Ubuntu-based environments.
|
|
29
|
+
|
|
30
|
+
This runtime includes specific configurations and setup for Ubuntu
|
|
31
|
+
containers, including proper Python path handling and environment setup.
|
|
32
|
+
It provides methods for executing Python files, managing the container
|
|
33
|
+
lifecycle, and handling file operations within the Ubuntu container.
|
|
34
|
+
|
|
35
|
+
Attributes:
|
|
36
|
+
python_path (str): Path to the Python interpreter in the container
|
|
37
|
+
docker_config (dict): Configuration dict for Docker container setup
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
def __init__(
|
|
41
|
+
self,
|
|
42
|
+
image: str,
|
|
43
|
+
port: int = 0,
|
|
44
|
+
remove: bool = True,
|
|
45
|
+
python_path: str = "/usr/bin/python3",
|
|
46
|
+
**kwargs,
|
|
47
|
+
):
|
|
48
|
+
r"""Initialize the Ubuntu Docker Runtime.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
image (str): Docker image name to use
|
|
52
|
+
port (int, optional): Port to expose. Defaults to 0 (random port)
|
|
53
|
+
remove (bool, optional): Whether to remove container after use.
|
|
54
|
+
Defaults to True
|
|
55
|
+
python_path (str, optional): Path to Python interpreter.
|
|
56
|
+
Defaults to "/usr/bin/python3"
|
|
57
|
+
**kwargs: Additional arguments passed to DockerRuntime
|
|
58
|
+
"""
|
|
59
|
+
super().__init__(image=image, port=port, remove=remove, **kwargs)
|
|
60
|
+
|
|
61
|
+
self.python_path = python_path
|
|
62
|
+
logger.info(
|
|
63
|
+
f"Initializing UbuntuDockerRuntime with python_path: {python_path}"
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Set default environment variables for Ubuntu
|
|
67
|
+
self.docker_config.setdefault("environment", {})
|
|
68
|
+
self.docker_config["environment"].update(
|
|
69
|
+
{
|
|
70
|
+
"PYTHON_PATH": python_path,
|
|
71
|
+
"PYTHON_EXECUTABLE": python_path,
|
|
72
|
+
"PATH": "/usr/local/bin:/usr/bin:/bin",
|
|
73
|
+
"PYTHONUNBUFFERED": "1",
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
logger.info(
|
|
77
|
+
f"Environment variables set: {self.docker_config['environment']}"
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
# Add default working directory
|
|
81
|
+
self.docker_config.setdefault("working_dir", "/app")
|
|
82
|
+
|
|
83
|
+
# Setup default volume mounts
|
|
84
|
+
self._setup_default_mounts()
|
|
85
|
+
|
|
86
|
+
def add(
|
|
87
|
+
self,
|
|
88
|
+
funcs: Union[FunctionTool, List[FunctionTool]],
|
|
89
|
+
entrypoint: str,
|
|
90
|
+
redirect_stdout: bool = False,
|
|
91
|
+
arguments: Optional[dict] = None,
|
|
92
|
+
) -> "UbuntuDockerRuntime":
|
|
93
|
+
r"""Add functions to the runtime with Ubuntu-specific modifications.
|
|
94
|
+
|
|
95
|
+
Args:
|
|
96
|
+
funcs: Function(s) to add to the runtime
|
|
97
|
+
entrypoint: Entry point for function execution
|
|
98
|
+
redirect_stdout: Whether to redirect stdout
|
|
99
|
+
arguments: Optional arguments for function execution
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Self for method chaining
|
|
103
|
+
"""
|
|
104
|
+
if not isinstance(funcs, list):
|
|
105
|
+
funcs = [funcs]
|
|
106
|
+
|
|
107
|
+
# Modify the code execution command to use python3
|
|
108
|
+
for func in funcs:
|
|
109
|
+
logger.info(f"Processing function: {func.get_function_name()}")
|
|
110
|
+
if hasattr(func, 'command'):
|
|
111
|
+
logger.info(f"Original command: {func.command}")
|
|
112
|
+
if isinstance(func.command, list):
|
|
113
|
+
if 'python' in func.command:
|
|
114
|
+
idx = func.command.index('python')
|
|
115
|
+
func.command[idx] = self.python_path
|
|
116
|
+
logger.info(f"Modified command: {func.command}")
|
|
117
|
+
else:
|
|
118
|
+
logger.info(
|
|
119
|
+
f"No command attribute found for function "
|
|
120
|
+
f"{func.get_function_name()}"
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
super().add(funcs, entrypoint, redirect_stdout, arguments)
|
|
124
|
+
return self
|
|
125
|
+
|
|
126
|
+
def _setup_default_mounts(self):
|
|
127
|
+
r"""Setup default volume mounts for the container.
|
|
128
|
+
|
|
129
|
+
This method can be extended to add Ubuntu-specific volume mounts.
|
|
130
|
+
"""
|
|
131
|
+
pass
|
|
132
|
+
|
|
133
|
+
def build(self, time_out: int = 15) -> "UbuntuDockerRuntime":
|
|
134
|
+
r"""Build and initialize the Ubuntu container with proper setup.
|
|
135
|
+
|
|
136
|
+
Args:
|
|
137
|
+
time_out (int): Timeout in seconds for build operation
|
|
138
|
+
|
|
139
|
+
Returns:
|
|
140
|
+
Self for method chaining
|
|
141
|
+
"""
|
|
142
|
+
logger.info("Starting container build...")
|
|
143
|
+
|
|
144
|
+
super().build(time_out=time_out)
|
|
145
|
+
|
|
146
|
+
if self.container:
|
|
147
|
+
logger.info("Container built successfully, verifying setup...")
|
|
148
|
+
|
|
149
|
+
# Verify Python installation
|
|
150
|
+
exit_code, output = self.container.exec_run(
|
|
151
|
+
[self.python_path, "--version"]
|
|
152
|
+
)
|
|
153
|
+
logger.info(f"Python version check result: {output.decode()}")
|
|
154
|
+
if exit_code != 0:
|
|
155
|
+
logger.error(
|
|
156
|
+
f"Python version check failed with exit code {exit_code}"
|
|
157
|
+
)
|
|
158
|
+
raise RuntimeError(
|
|
159
|
+
f"Python installation verification "
|
|
160
|
+
f"failed: {output.decode()}"
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
# Install required packages
|
|
164
|
+
logger.info("Installing required packages...")
|
|
165
|
+
exit_code, output = self.container.exec_run("apt-get update")
|
|
166
|
+
if exit_code != 0:
|
|
167
|
+
logger.error(
|
|
168
|
+
f"apt-get update failed with "
|
|
169
|
+
f"exit code {exit_code}: {output.decode()}"
|
|
170
|
+
)
|
|
171
|
+
raise RuntimeError(
|
|
172
|
+
f"Failed to update package lists: {output.decode()}"
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
exit_code, output = self.container.exec_run(
|
|
176
|
+
"apt-get install -y curl"
|
|
177
|
+
)
|
|
178
|
+
if exit_code != 0:
|
|
179
|
+
logger.error(
|
|
180
|
+
f"apt-get install curl failed with "
|
|
181
|
+
f"exit code {exit_code}: {output.decode()}"
|
|
182
|
+
)
|
|
183
|
+
raise RuntimeError(
|
|
184
|
+
f"Failed to install curl: {output.decode()}"
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
# Start API server with explicit Python path
|
|
188
|
+
logger.info("Starting API server...")
|
|
189
|
+
exec_result = self.container.exec_run(
|
|
190
|
+
[self.python_path, "/home/api.py"],
|
|
191
|
+
detach=True,
|
|
192
|
+
environment={
|
|
193
|
+
"PYTHONPATH": str(
|
|
194
|
+
Path(self.python_path).parent
|
|
195
|
+
/ "lib/python3.10/site-packages"
|
|
196
|
+
),
|
|
197
|
+
"PYTHON_EXECUTABLE": self.python_path,
|
|
198
|
+
},
|
|
199
|
+
)
|
|
200
|
+
logger.info("API server start result: %s", exec_result)
|
|
201
|
+
|
|
202
|
+
# Wait for API server to start
|
|
203
|
+
start_time = time.time()
|
|
204
|
+
while time.time() - start_time < 10:
|
|
205
|
+
try:
|
|
206
|
+
exit_code, curl_result = self.container.exec_run(
|
|
207
|
+
"curl -s -o /dev/null -w '%{http_code}' http://localhost:8000/docs"
|
|
208
|
+
)
|
|
209
|
+
status_code = curl_result.decode().strip()
|
|
210
|
+
if exit_code == 0 and status_code.startswith('2'):
|
|
211
|
+
logger.info(
|
|
212
|
+
f"API server is running "
|
|
213
|
+
f"(status code: {status_code})"
|
|
214
|
+
)
|
|
215
|
+
break
|
|
216
|
+
else:
|
|
217
|
+
logger.debug(
|
|
218
|
+
f"API server not ready yet (status: {status_code})"
|
|
219
|
+
)
|
|
220
|
+
except Exception as e:
|
|
221
|
+
logger.debug("Waiting for API server... %s", e)
|
|
222
|
+
time.sleep(0.5)
|
|
223
|
+
else:
|
|
224
|
+
logger.warning("API server may not be running properly")
|
|
225
|
+
|
|
226
|
+
return self
|
|
227
|
+
|
|
228
|
+
def exec_python_file(
|
|
229
|
+
self,
|
|
230
|
+
local_file_path: str,
|
|
231
|
+
container_path: Optional[str] = None,
|
|
232
|
+
args: Optional[List[str]] = None,
|
|
233
|
+
env: Optional[dict] = None,
|
|
234
|
+
callback: Optional[Callable[[str], None]] = None,
|
|
235
|
+
) -> None:
|
|
236
|
+
r"""Execute a Python file inside the Docker container.
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
local_file_path: Path to the Python file on the local filesystem
|
|
240
|
+
container_path: Path where the file should be copied in the
|
|
241
|
+
container If None, the file will be copied to /tmp/
|
|
242
|
+
args: List of command-line arguments to pass to the Python script
|
|
243
|
+
env: Additional environment variables to set for the execution
|
|
244
|
+
callback: Optional function to process each line of output
|
|
245
|
+
If None, output is printed to stdout
|
|
246
|
+
|
|
247
|
+
Raises:
|
|
248
|
+
RuntimeError: If container is not running
|
|
249
|
+
FileNotFoundError: If Python file is not found
|
|
250
|
+
"""
|
|
251
|
+
if not self.container:
|
|
252
|
+
raise RuntimeError("Container is not running. Call build() first.")
|
|
253
|
+
|
|
254
|
+
local_path = Path(local_file_path)
|
|
255
|
+
if not local_path.exists():
|
|
256
|
+
raise FileNotFoundError(f"Python file {local_file_path} not found")
|
|
257
|
+
|
|
258
|
+
# Determine where to put the file in the container
|
|
259
|
+
if container_path is None:
|
|
260
|
+
container_path = f"/tmp/{local_path.name}"
|
|
261
|
+
|
|
262
|
+
logger.info(
|
|
263
|
+
f"Copying {local_file_path} to container at {container_path}"
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
# Copy the file to the container
|
|
267
|
+
self.container.put_archive(
|
|
268
|
+
path=str(Path(container_path).parent),
|
|
269
|
+
data=self._create_archive_from_file(local_path),
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
# Prepare command
|
|
273
|
+
cmd = [self.python_path, container_path]
|
|
274
|
+
if args:
|
|
275
|
+
cmd.extend(args)
|
|
276
|
+
|
|
277
|
+
# Prepare environment
|
|
278
|
+
execution_env = {
|
|
279
|
+
"PYTHONPATH": "/usr/local/lib/python3.10/site-packages",
|
|
280
|
+
"PYTHON_EXECUTABLE": self.python_path,
|
|
281
|
+
}
|
|
282
|
+
execution_env["PYTHONPATH"] = str(
|
|
283
|
+
Path(self.python_path).parent / "lib/python3.10/site-packages"
|
|
284
|
+
)
|
|
285
|
+
if env:
|
|
286
|
+
execution_env.update(env)
|
|
287
|
+
|
|
288
|
+
logger.info(f"Executing Python file with command: {cmd}")
|
|
289
|
+
|
|
290
|
+
# Always use streaming output
|
|
291
|
+
exec_result = self.container.exec_run(
|
|
292
|
+
cmd,
|
|
293
|
+
environment=execution_env,
|
|
294
|
+
stream=True,
|
|
295
|
+
demux=True, # Separate stdout and stderr
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
# Handle output streams
|
|
299
|
+
try:
|
|
300
|
+
for stdout, stderr in exec_result[1]:
|
|
301
|
+
if stdout:
|
|
302
|
+
output = stdout.decode('utf-8')
|
|
303
|
+
if callback:
|
|
304
|
+
callback(output)
|
|
305
|
+
else:
|
|
306
|
+
print(output, end='')
|
|
307
|
+
|
|
308
|
+
if stderr:
|
|
309
|
+
error = stderr.decode('utf-8')
|
|
310
|
+
if callback:
|
|
311
|
+
callback(f"ERROR: {error}")
|
|
312
|
+
else:
|
|
313
|
+
print(f"ERROR: {error}", end='', file=sys.stderr)
|
|
314
|
+
except KeyboardInterrupt:
|
|
315
|
+
logger.info("Execution interrupted by user")
|
|
316
|
+
# Could add logic to stop container processes here
|
|
317
|
+
except Exception as e:
|
|
318
|
+
logger.error(f"Error during execution: {e}")
|
|
319
|
+
raise
|
|
320
|
+
|
|
321
|
+
def _create_archive_from_file(self, file_path: Union[str, Path]) -> bytes:
|
|
322
|
+
r"""Create a tar archive from a single file for docker.put_archive().
|
|
323
|
+
|
|
324
|
+
Args:
|
|
325
|
+
file_path: Path to the file to archive
|
|
326
|
+
|
|
327
|
+
Returns:
|
|
328
|
+
bytes: The tar archive as bytes
|
|
329
|
+
"""
|
|
330
|
+
import io
|
|
331
|
+
import tarfile
|
|
332
|
+
|
|
333
|
+
file_path = Path(file_path)
|
|
334
|
+
tar_stream = io.BytesIO()
|
|
335
|
+
|
|
336
|
+
with tarfile.open(fileobj=tar_stream, mode='w') as tar:
|
|
337
|
+
tar.add(file_path, arcname=file_path.name)
|
|
338
|
+
|
|
339
|
+
tar_stream.seek(0)
|
|
340
|
+
return tar_stream.read()
|