camel-ai 0.2.50__tar.gz → 0.2.52__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.50 → camel_ai-0.2.52}/PKG-INFO +3 -1
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/__init__.py +1 -1
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/environments/single_step.py +79 -11
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/azure_openai_model.py +27 -9
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/ollama_model.py +15 -10
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/vllm_model.py +15 -9
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/__init__.py +2 -0
- camel_ai-0.2.52/camel/runtime/daytona_runtime.py +248 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/__init__.py +2 -0
- camel_ai-0.2.52/camel/toolkits/klavis_toolkit.py +228 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/mcp_toolkit.py +19 -3
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/enums.py +3 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/commons.py +2 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/pyproject.toml +4 -1
- {camel_ai-0.2.50 → camel_ai-0.2.52}/.gitignore +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/LICENSE +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/README.md +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/_utils.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/repo_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/apibank.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/apibench.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/gaia.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/nexus.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/bedrock_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/lmstudio_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/modelscope_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/netmind_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/novita_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/openrouter_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/ppio_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/sglang_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/watsonx_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/data_collector/sharegpt_collector.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/evol_instruct/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/evol_instruct/evol_instruct.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/evol_instruct/scorer.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/evol_instruct/templates.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datahubs/huggingface.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/base_generator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/few_shot_generator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/self_instruct_generator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/datasets/static_dataset.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/azure_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/together_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/environments/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/environments/multi_step.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/environments/tic_tac_toe.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/extractors/python_strategies.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/generators.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/human.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/docker_interpreter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/e2b_interpreter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/interpreters/subprocess_interpreter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/base_io.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/chunkr_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/crawl4ai_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/pandas_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/scrapegraph_reader.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/logger.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/context_creators/score_based.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/memories/records.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/conversation_models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/messages/func_message.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/aiml_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/anthropic_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/aws_bedrock_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/base_audio_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/base_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/cohere_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/deepseek_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/gemini_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/groq_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/internlm_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/litellm_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/lmstudio_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/mistral_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/model_factory.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/modelscope_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/moonshot_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/nemotron_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/netmind_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/novita_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/nvidia_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/openai_audio_models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/openai_compatible_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/openai_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/openrouter_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/ppio_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/qwen_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reka_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/samba_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/sglang_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/siliconflow_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/stub_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/togetherai_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/volcano_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/watsonx_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/yi_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/models/zhipuai_model.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/personas/persona.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/py.typed +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/auto_retriever.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/api.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/docker_runtime.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/remote_http_runtime.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/ubuntu_docker_runtime.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/graph_storages/neo4j_graph.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/json.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/mem0_cloud.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/key_value_storages/redis.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/oceanbase.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/storages/vectordb_storages/tidb.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/audio_analysis_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/browser_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/dalle_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/excel_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/file_write_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/google_calendar_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/image_analysis_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/jina_reranker_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/linkedin_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/memory_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/networkx_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/openai_agent_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/pubmed_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/pyautogui_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/search_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/searxng_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/slack_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/stripe_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/sympy_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/thinking_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/video_analysis_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/weather_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/toolkits/zapier_toolkit.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/chunker/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/chunker/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/chunker/code_chunker.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/chunker/uio_chunker.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/filename.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/mcp.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/verifiers/base.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/verifiers/math_verifier.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/verifiers/models.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/camel/verifiers/physics_verifier.py +0 -0
- {camel_ai-0.2.50 → camel_ai-0.2.52}/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.52
|
|
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
|
|
@@ -36,6 +36,7 @@ Requires-Dist: dappier<0.4,>=0.3.3; extra == 'all'
|
|
|
36
36
|
Requires-Dist: datacommons-pandas<0.0.4,>=0.0.3; extra == 'all'
|
|
37
37
|
Requires-Dist: datacommons<2,>=1.4.3; extra == 'all'
|
|
38
38
|
Requires-Dist: datasets<4,>=3; extra == 'all'
|
|
39
|
+
Requires-Dist: daytona-sdk==0.14.0; extra == 'all'
|
|
39
40
|
Requires-Dist: diffusers<0.26,>=0.25.0; extra == 'all'
|
|
40
41
|
Requires-Dist: discord-py<3,>=2.3.2; extra == 'all'
|
|
41
42
|
Requires-Dist: docker<8,>=7.1.0; extra == 'all'
|
|
@@ -170,6 +171,7 @@ Requires-Dist: types-tqdm<5,>=4.66.0; extra == 'dev'
|
|
|
170
171
|
Requires-Dist: uv==0.6.5; extra == 'dev'
|
|
171
172
|
Provides-Extra: dev-tools
|
|
172
173
|
Requires-Dist: agentops<0.4,>=0.3.21; extra == 'dev-tools'
|
|
174
|
+
Requires-Dist: daytona-sdk==0.14.0; extra == 'dev-tools'
|
|
173
175
|
Requires-Dist: docker<8,>=7.1.0; extra == 'dev-tools'
|
|
174
176
|
Requires-Dist: e2b-code-interpreter<2,>=1.0.3; extra == 'dev-tools'
|
|
175
177
|
Requires-Dist: ipykernel<7,>=6.0.0; extra == 'dev-tools'
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
|
|
15
|
+
import asyncio
|
|
15
16
|
import random
|
|
16
17
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
18
|
|
|
@@ -58,6 +59,7 @@ class SingleStepEnv:
|
|
|
58
59
|
self,
|
|
59
60
|
dataset: Union[StaticDataset, BaseGenerator],
|
|
60
61
|
verifier: BaseVerifier,
|
|
62
|
+
timeout: Optional[float] = 180.0,
|
|
61
63
|
**kwargs,
|
|
62
64
|
) -> None:
|
|
63
65
|
r"""Initialize the SingleStepEnv.
|
|
@@ -67,12 +69,15 @@ class SingleStepEnv:
|
|
|
67
69
|
problems from.
|
|
68
70
|
verifier (BaseVerifier): Verifier used to evaluate LLM responses
|
|
69
71
|
against ground-truth answers.
|
|
72
|
+
timeout (Optional[float], optional): The execution timeout in
|
|
73
|
+
seconds. (default: :obj:`180.0`)
|
|
70
74
|
**kwargs: Optional metadata or configuration values.
|
|
71
75
|
|
|
72
76
|
Notes:
|
|
73
77
|
This class assumes all interactions are single-step: one question,
|
|
74
78
|
one LLM response, one reward.
|
|
75
79
|
"""
|
|
80
|
+
self._timeout = timeout
|
|
76
81
|
self.dataset = dataset
|
|
77
82
|
self.verifier = verifier
|
|
78
83
|
self._metadata = kwargs
|
|
@@ -279,6 +284,7 @@ class SingleStepEnv:
|
|
|
279
284
|
or if `reset()` has not been called.
|
|
280
285
|
ValueError: If invalid action format, duplicate indices,
|
|
281
286
|
or out-of-bounds indices are detected.
|
|
287
|
+
asyncio.TimeoutError: If the step execution exceeds the timeout.
|
|
282
288
|
"""
|
|
283
289
|
|
|
284
290
|
if not self._is_setup:
|
|
@@ -307,18 +313,34 @@ class SingleStepEnv:
|
|
|
307
313
|
f"total batch size ({self.current_batch_size})"
|
|
308
314
|
)
|
|
309
315
|
|
|
310
|
-
indices = [act.index for act in actions]
|
|
311
316
|
proposed_solutions = [act.llm_response for act in actions]
|
|
312
|
-
ground_truths: List[str] = [
|
|
313
|
-
|
|
314
|
-
|
|
317
|
+
ground_truths: List[str] = [
|
|
318
|
+
self._states[idx].final_answer for idx in indices
|
|
319
|
+
]
|
|
315
320
|
|
|
316
321
|
try:
|
|
317
|
-
verification_results = await
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
322
|
+
verification_results = await asyncio.wait_for(
|
|
323
|
+
self.verifier.verify_batch(
|
|
324
|
+
solutions=proposed_solutions,
|
|
325
|
+
reference_answers=ground_truths, # type: ignore [arg-type]
|
|
326
|
+
raise_on_error=True,
|
|
327
|
+
),
|
|
328
|
+
timeout=self._timeout,
|
|
329
|
+
)
|
|
330
|
+
except asyncio.TimeoutError as e:
|
|
331
|
+
logger.error(
|
|
332
|
+
f"Step verification timed out after {self._timeout}s: {e}"
|
|
321
333
|
)
|
|
334
|
+
# Return timeout verification results
|
|
335
|
+
verification_results = [
|
|
336
|
+
VerificationResult(
|
|
337
|
+
result="",
|
|
338
|
+
status=VerificationOutcome.TIMEOUT,
|
|
339
|
+
error_message=f"Verification timed out "
|
|
340
|
+
f"after {self._timeout}s",
|
|
341
|
+
)
|
|
342
|
+
for _ in range(len(proposed_solutions))
|
|
343
|
+
]
|
|
322
344
|
except Exception as e:
|
|
323
345
|
logger.error(f"Verification failed: {e}")
|
|
324
346
|
# Return failed verification results with status=FAILURE
|
|
@@ -331,9 +353,55 @@ class SingleStepEnv:
|
|
|
331
353
|
for _ in range(len(proposed_solutions))
|
|
332
354
|
]
|
|
333
355
|
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
)
|
|
356
|
+
# Track which solutions have been processed and which have timed out
|
|
357
|
+
total_rewards = [0.0] * len(proposed_solutions)
|
|
358
|
+
rewards_dicts = [{"correctness": 0.0}] * len(proposed_solutions)
|
|
359
|
+
|
|
360
|
+
try:
|
|
361
|
+
# First try to compute all rewards with a timeout
|
|
362
|
+
computed_rewards, computed_rewards_dicts = await asyncio.wait_for(
|
|
363
|
+
self._compute_reward_batch(
|
|
364
|
+
proposed_solutions, verification_results
|
|
365
|
+
),
|
|
366
|
+
timeout=self._timeout,
|
|
367
|
+
)
|
|
368
|
+
# If successful, use all the computed values
|
|
369
|
+
total_rewards = computed_rewards
|
|
370
|
+
rewards_dicts = computed_rewards_dicts
|
|
371
|
+
except asyncio.TimeoutError as e:
|
|
372
|
+
logger.error(
|
|
373
|
+
f"Reward computation timed out after {self._timeout}s: {e}"
|
|
374
|
+
)
|
|
375
|
+
# Try to compute rewards one by one to identify which ones time out
|
|
376
|
+
for i, (solution, result) in enumerate(
|
|
377
|
+
zip(proposed_solutions, verification_results)
|
|
378
|
+
):
|
|
379
|
+
try:
|
|
380
|
+
individual_rewards = await asyncio.wait_for(
|
|
381
|
+
self._compute_custom_reward(solution, result),
|
|
382
|
+
timeout=self._timeout,
|
|
383
|
+
)
|
|
384
|
+
# If successful, calculate the reward for this solution
|
|
385
|
+
correctness_reward = (
|
|
386
|
+
self.ACCURACY_REWARD if result.status else 0.0
|
|
387
|
+
)
|
|
388
|
+
rewards_dict = {
|
|
389
|
+
"correctness": correctness_reward,
|
|
390
|
+
**individual_rewards,
|
|
391
|
+
}
|
|
392
|
+
total_rewards[i] = sum(rewards_dict.values())
|
|
393
|
+
rewards_dicts[i] = rewards_dict
|
|
394
|
+
except asyncio.TimeoutError:
|
|
395
|
+
logger.warning(
|
|
396
|
+
f"Reward computation for solution {i} timed out"
|
|
397
|
+
)
|
|
398
|
+
except Exception as e:
|
|
399
|
+
logger.warning(
|
|
400
|
+
f"Error computing reward for solution {i}: {e}"
|
|
401
|
+
)
|
|
402
|
+
except Exception as e:
|
|
403
|
+
logger.error(f"Reward computation failed: {e}")
|
|
404
|
+
|
|
337
405
|
# Create and return step results in batch
|
|
338
406
|
step_results = [
|
|
339
407
|
StepResult(
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
import os
|
|
15
|
-
from typing import Any, Dict, List, Optional, Type, Union
|
|
15
|
+
from typing import Any, Callable, Dict, List, Optional, Type, Union
|
|
16
16
|
|
|
17
17
|
from openai import AsyncAzureOpenAI, AsyncStream, AzureOpenAI, Stream
|
|
18
18
|
from pydantic import BaseModel
|
|
@@ -27,6 +27,8 @@ from camel.types import (
|
|
|
27
27
|
)
|
|
28
28
|
from camel.utils import BaseTokenCounter, OpenAITokenCounter
|
|
29
29
|
|
|
30
|
+
AzureADTokenProvider = Callable[[], str]
|
|
31
|
+
|
|
30
32
|
|
|
31
33
|
class AzureOpenAIModel(BaseModelBackend):
|
|
32
34
|
r"""Azure OpenAI API in a unified BaseModelBackend interface.
|
|
@@ -46,6 +48,12 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
46
48
|
(default: :obj:`None`)
|
|
47
49
|
azure_deployment_name (Optional[str], optional): The deployment name
|
|
48
50
|
you chose when you deployed an azure model. (default: :obj:`None`)
|
|
51
|
+
azure_ad_token (Optional[str], optional): Your Azure Active Directory
|
|
52
|
+
token, https://www.microsoft.com/en-us/security/business/
|
|
53
|
+
identity-access/microsoft-entra-id. (default: :obj:`None`)
|
|
54
|
+
azure_ad_token_provider (Optional[AzureADTokenProvider], optional): A
|
|
55
|
+
function that returns an Azure Active Directory token, will be
|
|
56
|
+
invoked on every request. (default: :obj:`None`)
|
|
49
57
|
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
50
58
|
use for the model. If not provided, :obj:`OpenAITokenCounter`
|
|
51
59
|
will be used. (default: :obj:`None`)
|
|
@@ -68,6 +76,8 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
68
76
|
token_counter: Optional[BaseTokenCounter] = None,
|
|
69
77
|
api_version: Optional[str] = None,
|
|
70
78
|
azure_deployment_name: Optional[str] = None,
|
|
79
|
+
azure_ad_token_provider: Optional["AzureADTokenProvider"] = None,
|
|
80
|
+
azure_ad_token: Optional[str] = None,
|
|
71
81
|
) -> None:
|
|
72
82
|
if model_config_dict is None:
|
|
73
83
|
model_config_dict = ChatGPTConfig().as_dict()
|
|
@@ -79,15 +89,19 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
79
89
|
)
|
|
80
90
|
|
|
81
91
|
self.api_version = api_version or os.environ.get("AZURE_API_VERSION")
|
|
82
|
-
self.
|
|
92
|
+
self._azure_deployment_name = azure_deployment_name or os.environ.get(
|
|
83
93
|
"AZURE_DEPLOYMENT_NAME"
|
|
84
94
|
)
|
|
95
|
+
self._azure_ad_token = azure_ad_token or os.environ.get(
|
|
96
|
+
"AZURE_AD_TOKEN"
|
|
97
|
+
)
|
|
98
|
+
self.azure_ad_token_provider = azure_ad_token_provider
|
|
85
99
|
if self.api_version is None:
|
|
86
100
|
raise ValueError(
|
|
87
101
|
"Must provide either the `api_version` argument "
|
|
88
102
|
"or `AZURE_API_VERSION` environment variable."
|
|
89
103
|
)
|
|
90
|
-
if self.
|
|
104
|
+
if self._azure_deployment_name is None:
|
|
91
105
|
raise ValueError(
|
|
92
106
|
"Must provide either the `azure_deployment_name` argument "
|
|
93
107
|
"or `AZURE_DEPLOYMENT_NAME` environment variable."
|
|
@@ -95,18 +109,22 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
95
109
|
|
|
96
110
|
self._client = AzureOpenAI(
|
|
97
111
|
azure_endpoint=str(self._url),
|
|
98
|
-
azure_deployment=self.
|
|
112
|
+
azure_deployment=self._azure_deployment_name,
|
|
99
113
|
api_version=self.api_version,
|
|
100
114
|
api_key=self._api_key,
|
|
115
|
+
azure_ad_token=self._azure_ad_token,
|
|
116
|
+
azure_ad_token_provider=self.azure_ad_token_provider,
|
|
101
117
|
timeout=self._timeout,
|
|
102
118
|
max_retries=3,
|
|
103
119
|
)
|
|
104
120
|
|
|
105
121
|
self._async_client = AsyncAzureOpenAI(
|
|
106
122
|
azure_endpoint=str(self._url),
|
|
107
|
-
azure_deployment=self.
|
|
123
|
+
azure_deployment=self._azure_deployment_name,
|
|
108
124
|
api_version=self.api_version,
|
|
109
125
|
api_key=self._api_key,
|
|
126
|
+
azure_ad_token=self._azure_ad_token,
|
|
127
|
+
azure_ad_token_provider=self.azure_ad_token_provider,
|
|
110
128
|
timeout=self._timeout,
|
|
111
129
|
max_retries=3,
|
|
112
130
|
)
|
|
@@ -193,7 +211,7 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
193
211
|
|
|
194
212
|
return self._client.chat.completions.create(
|
|
195
213
|
messages=messages,
|
|
196
|
-
model=self.
|
|
214
|
+
model=self._azure_deployment_name, # type:ignore[arg-type]
|
|
197
215
|
**request_config,
|
|
198
216
|
)
|
|
199
217
|
|
|
@@ -209,7 +227,7 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
209
227
|
|
|
210
228
|
return await self._async_client.chat.completions.create(
|
|
211
229
|
messages=messages,
|
|
212
|
-
model=self.
|
|
230
|
+
model=self._azure_deployment_name, # type:ignore[arg-type]
|
|
213
231
|
**request_config,
|
|
214
232
|
)
|
|
215
233
|
|
|
@@ -232,7 +250,7 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
232
250
|
|
|
233
251
|
return self._client.beta.chat.completions.parse(
|
|
234
252
|
messages=messages,
|
|
235
|
-
model=self.
|
|
253
|
+
model=self._azure_deployment_name, # type:ignore[arg-type]
|
|
236
254
|
**request_config,
|
|
237
255
|
)
|
|
238
256
|
|
|
@@ -255,7 +273,7 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
255
273
|
|
|
256
274
|
return await self._async_client.beta.chat.completions.parse(
|
|
257
275
|
messages=messages,
|
|
258
|
-
model=self.
|
|
276
|
+
model=self._azure_deployment_name, # type:ignore[arg-type]
|
|
259
277
|
**request_config,
|
|
260
278
|
)
|
|
261
279
|
|
|
@@ -16,10 +16,13 @@ import subprocess
|
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
18
|
from camel.configs import OLLAMA_API_PARAMS, OllamaConfig
|
|
19
|
+
from camel.logger import get_logger
|
|
19
20
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
21
|
from camel.types import ModelType
|
|
21
22
|
from camel.utils import BaseTokenCounter
|
|
22
23
|
|
|
24
|
+
logger = get_logger(__name__)
|
|
25
|
+
|
|
23
26
|
|
|
24
27
|
class OllamaModel(OpenAICompatibleModel):
|
|
25
28
|
r"""Ollama service interface.
|
|
@@ -60,20 +63,22 @@ class OllamaModel(OpenAICompatibleModel):
|
|
|
60
63
|
) -> None:
|
|
61
64
|
if model_config_dict is None:
|
|
62
65
|
model_config_dict = OllamaConfig().as_dict()
|
|
63
|
-
|
|
66
|
+
self._url = url or os.environ.get("OLLAMA_BASE_URL")
|
|
64
67
|
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
68
|
+
self._model_type = model_type
|
|
69
|
+
|
|
70
|
+
if not self._url:
|
|
71
|
+
self._start_server()
|
|
72
|
+
|
|
65
73
|
super().__init__(
|
|
66
|
-
model_type=
|
|
74
|
+
model_type=self._model_type,
|
|
67
75
|
model_config_dict=model_config_dict,
|
|
68
|
-
api_key=
|
|
69
|
-
url=
|
|
76
|
+
api_key="Not_Used",
|
|
77
|
+
url=self._url,
|
|
70
78
|
token_counter=token_counter,
|
|
71
79
|
timeout=timeout,
|
|
72
80
|
)
|
|
73
81
|
|
|
74
|
-
if not self._url:
|
|
75
|
-
self._start_server()
|
|
76
|
-
|
|
77
82
|
def _start_server(self) -> None:
|
|
78
83
|
r"""Starts the Ollama server in a subprocess."""
|
|
79
84
|
try:
|
|
@@ -83,12 +88,12 @@ class OllamaModel(OpenAICompatibleModel):
|
|
|
83
88
|
stderr=subprocess.PIPE,
|
|
84
89
|
)
|
|
85
90
|
self._url = "http://localhost:11434/v1"
|
|
86
|
-
|
|
91
|
+
logger.info(
|
|
87
92
|
f"Ollama server started on {self._url} "
|
|
88
|
-
f"for {self.
|
|
93
|
+
f"for {self._model_type} model."
|
|
89
94
|
)
|
|
90
95
|
except Exception as e:
|
|
91
|
-
|
|
96
|
+
logger.error(f"Failed to start Ollama server: {e}.")
|
|
92
97
|
|
|
93
98
|
def check_model_config(self):
|
|
94
99
|
r"""Check whether the model configuration contains any
|
|
@@ -16,10 +16,13 @@ import subprocess
|
|
|
16
16
|
from typing import Any, Dict, Optional, Union
|
|
17
17
|
|
|
18
18
|
from camel.configs import VLLM_API_PARAMS, VLLMConfig
|
|
19
|
+
from camel.logger import get_logger
|
|
19
20
|
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
21
|
from camel.types import ModelType
|
|
21
22
|
from camel.utils import BaseTokenCounter
|
|
22
23
|
|
|
24
|
+
logger = get_logger(__name__)
|
|
25
|
+
|
|
23
26
|
|
|
24
27
|
# flake8: noqa: E501
|
|
25
28
|
class VLLMModel(OpenAICompatibleModel):
|
|
@@ -62,18 +65,21 @@ class VLLMModel(OpenAICompatibleModel):
|
|
|
62
65
|
) -> None:
|
|
63
66
|
if model_config_dict is None:
|
|
64
67
|
model_config_dict = VLLMConfig().as_dict()
|
|
65
|
-
|
|
68
|
+
self._url = url or os.environ.get("VLLM_BASE_URL")
|
|
66
69
|
timeout = timeout or float(os.environ.get("MODEL_TIMEOUT", 180))
|
|
70
|
+
self._model_type = model_type
|
|
71
|
+
|
|
72
|
+
if not self._url:
|
|
73
|
+
self._start_server()
|
|
74
|
+
|
|
67
75
|
super().__init__(
|
|
68
|
-
model_type=
|
|
76
|
+
model_type=self._model_type,
|
|
69
77
|
model_config_dict=model_config_dict,
|
|
70
|
-
api_key=
|
|
71
|
-
url=
|
|
78
|
+
api_key="Not_Used",
|
|
79
|
+
url=self._url,
|
|
72
80
|
token_counter=token_counter,
|
|
73
81
|
timeout=timeout,
|
|
74
82
|
)
|
|
75
|
-
if not self._url:
|
|
76
|
-
self._start_server()
|
|
77
83
|
|
|
78
84
|
def _start_server(self) -> None:
|
|
79
85
|
r"""Starts the vllm server in a subprocess."""
|
|
@@ -84,12 +90,12 @@ class VLLMModel(OpenAICompatibleModel):
|
|
|
84
90
|
stderr=subprocess.PIPE,
|
|
85
91
|
)
|
|
86
92
|
self._url = "http://localhost:8000/v1"
|
|
87
|
-
|
|
93
|
+
logger.info(
|
|
88
94
|
f"vllm server started on {self._url} "
|
|
89
|
-
f"for {self.
|
|
95
|
+
f"for {self._model_type} model."
|
|
90
96
|
)
|
|
91
97
|
except Exception as e:
|
|
92
|
-
|
|
98
|
+
logger.error(f"Failed to start vllm server: {e}.")
|
|
93
99
|
|
|
94
100
|
def check_model_config(self):
|
|
95
101
|
r"""Check whether the model configuration contains any
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
from .base import BaseRuntime
|
|
15
15
|
from .configs import TaskConfig
|
|
16
|
+
from .daytona_runtime import DaytonaRuntime
|
|
16
17
|
from .docker_runtime import DockerRuntime
|
|
17
18
|
from .llm_guard_runtime import LLMGuardRuntime
|
|
18
19
|
from .remote_http_runtime import RemoteHttpRuntime
|
|
@@ -28,4 +29,5 @@ __all__ = [
|
|
|
28
29
|
"LLMGuardRuntime",
|
|
29
30
|
"TaskConfig",
|
|
30
31
|
"UbuntuDockerRuntime",
|
|
32
|
+
"DaytonaRuntime",
|
|
31
33
|
]
|
|
@@ -0,0 +1,248 @@
|
|
|
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 inspect
|
|
16
|
+
import json
|
|
17
|
+
import os
|
|
18
|
+
from functools import wraps
|
|
19
|
+
from typing import Any, Dict, List, Optional, Union
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel
|
|
22
|
+
|
|
23
|
+
from camel.logger import get_logger
|
|
24
|
+
from camel.runtime import BaseRuntime
|
|
25
|
+
from camel.toolkits.function_tool import FunctionTool
|
|
26
|
+
|
|
27
|
+
logger = get_logger(__name__)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class DaytonaRuntime(BaseRuntime):
|
|
31
|
+
r"""A runtime that executes functions in a Daytona sandbox environment.
|
|
32
|
+
Requires the Daytona server to be running and an API key configured.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
api_key (Optional[str]): The Daytona API key for authentication. If not
|
|
36
|
+
provided, it will try to use the DAYTONA_API_KEY environment
|
|
37
|
+
variable. (default: :obj: `None`)
|
|
38
|
+
api_url (Optional[str]): The URL of the Daytona server. If not
|
|
39
|
+
provided, it will try to use the DAYTONA_API_URL environment
|
|
40
|
+
variable. If none is provided, it will use "http://localhost:8000".
|
|
41
|
+
(default: :obj: `None`)
|
|
42
|
+
language (Optional[str]): The programming language for the sandbox.
|
|
43
|
+
(default: :obj: `"python"`)
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self,
|
|
48
|
+
api_key: Optional[str] = None,
|
|
49
|
+
api_url: Optional[str] = None,
|
|
50
|
+
language: Optional[str] = "python",
|
|
51
|
+
):
|
|
52
|
+
from daytona_sdk import Daytona, DaytonaConfig
|
|
53
|
+
|
|
54
|
+
super().__init__()
|
|
55
|
+
self.api_key = api_key or os.environ.get('DAYTONA_API_KEY')
|
|
56
|
+
self.api_url = api_url or os.environ.get('DAYTONA_API_URL')
|
|
57
|
+
self.language = language
|
|
58
|
+
self.config = DaytonaConfig(api_key=self.api_key, api_url=self.api_url)
|
|
59
|
+
self.daytona = Daytona(self.config)
|
|
60
|
+
self.sandbox = None
|
|
61
|
+
self.entrypoint: Dict[str, str] = dict()
|
|
62
|
+
|
|
63
|
+
def build(self) -> "DaytonaRuntime":
|
|
64
|
+
r"""Create and start a Daytona sandbox.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
DaytonaRuntime: The current runtime.
|
|
68
|
+
"""
|
|
69
|
+
from daytona_sdk import CreateSandboxParams
|
|
70
|
+
|
|
71
|
+
try:
|
|
72
|
+
params = CreateSandboxParams(language=self.language)
|
|
73
|
+
self.sandbox = self.daytona.create(params)
|
|
74
|
+
if self.sandbox is None:
|
|
75
|
+
raise RuntimeError("Failed to create sandbox.")
|
|
76
|
+
logger.info(f"Sandbox created with ID: {self.sandbox.id}")
|
|
77
|
+
except Exception as e:
|
|
78
|
+
logger.error(f"Failed to create sandbox: {e!s}")
|
|
79
|
+
raise RuntimeError(f"Daytona sandbox creation failed: {e!s}")
|
|
80
|
+
return self
|
|
81
|
+
|
|
82
|
+
def _cleanup(self):
|
|
83
|
+
r"""Clean up the sandbox when exiting."""
|
|
84
|
+
if self.sandbox:
|
|
85
|
+
try:
|
|
86
|
+
self.daytona.remove(self.sandbox)
|
|
87
|
+
logger.info(f"Sandbox {self.sandbox.id} removed")
|
|
88
|
+
self.sandbox = None
|
|
89
|
+
except Exception as e:
|
|
90
|
+
logger.error(f"Failed to remove sandbox: {e!s}")
|
|
91
|
+
|
|
92
|
+
def add(
|
|
93
|
+
self,
|
|
94
|
+
funcs: Union[FunctionTool, List[FunctionTool]],
|
|
95
|
+
entrypoint: str,
|
|
96
|
+
arguments: Optional[Dict[str, Any]] = None,
|
|
97
|
+
) -> "DaytonaRuntime":
|
|
98
|
+
r"""Add a function or list of functions to the runtime.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
funcs (Union[FunctionTool, List[FunctionTool]]): The function or
|
|
102
|
+
list of functions to add.
|
|
103
|
+
entrypoint (str): The entrypoint for the function.
|
|
104
|
+
arguments (Optional[Dict[str, Any]]): The arguments for the
|
|
105
|
+
function. (default: :obj: `None`)
|
|
106
|
+
|
|
107
|
+
Returns:
|
|
108
|
+
DaytonaRuntime: The current runtime.
|
|
109
|
+
"""
|
|
110
|
+
if not isinstance(funcs, list):
|
|
111
|
+
funcs = [funcs]
|
|
112
|
+
if arguments is not None:
|
|
113
|
+
entrypoint += json.dumps(arguments, ensure_ascii=False)
|
|
114
|
+
|
|
115
|
+
def make_wrapper(inner_func, func_name, func_code):
|
|
116
|
+
r"""Creates a wrapper for a function to execute it in the
|
|
117
|
+
Daytona sandbox.
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
inner_func (Callable): The function to wrap.
|
|
121
|
+
func_name (str): The name of the function.
|
|
122
|
+
func_code (str): The source code of the function.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
Callable: A wrapped function that executes in the sandbox.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
@wraps(inner_func)
|
|
129
|
+
def wrapper(*args, **kwargs):
|
|
130
|
+
if not self.sandbox:
|
|
131
|
+
raise RuntimeError(
|
|
132
|
+
"Sandbox not initialized. Call build() first."
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
try:
|
|
136
|
+
for key, value in kwargs.items():
|
|
137
|
+
if isinstance(value, BaseModel):
|
|
138
|
+
kwargs[key] = value.model_dump()
|
|
139
|
+
args_str = json.dumps(args, ensure_ascii=True)
|
|
140
|
+
kwargs_str = json.dumps(kwargs, ensure_ascii=True)
|
|
141
|
+
except (TypeError, ValueError) as e:
|
|
142
|
+
logger.error(f"Failed to serialize arguments: {e!s}")
|
|
143
|
+
return {"error": f"Argument serialization failed: {e!s}"}
|
|
144
|
+
|
|
145
|
+
# Upload function code to the sandbox
|
|
146
|
+
script_path = f"/home/daytona/{func_name}.py"
|
|
147
|
+
try:
|
|
148
|
+
self.sandbox.fs.upload_file(
|
|
149
|
+
script_path, func_code.encode()
|
|
150
|
+
)
|
|
151
|
+
except Exception as e:
|
|
152
|
+
logger.error(
|
|
153
|
+
f"Failed to upload function {func_name}: {e!s}"
|
|
154
|
+
)
|
|
155
|
+
return {"error": f"Upload failed: {e!s}"}
|
|
156
|
+
|
|
157
|
+
exec_code = (
|
|
158
|
+
f"import sys\n"
|
|
159
|
+
f"sys.path.append('/home/daytona')\n"
|
|
160
|
+
f"import json\n"
|
|
161
|
+
f"from {func_name} import {func_name}\n"
|
|
162
|
+
f"args = json.loads('{args_str}')\n"
|
|
163
|
+
f"kwargs = json.loads('{kwargs_str}')\n"
|
|
164
|
+
f"result = {func_name}(*args, **kwargs)\n"
|
|
165
|
+
f"print(json.dumps(result) if result is not "
|
|
166
|
+
f"None else 'null')"
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
# Execute the function in the sandbox
|
|
170
|
+
try:
|
|
171
|
+
response = self.sandbox.process.code_run(exec_code)
|
|
172
|
+
return (
|
|
173
|
+
json.loads(response.result)
|
|
174
|
+
if response.result
|
|
175
|
+
else None
|
|
176
|
+
)
|
|
177
|
+
except json.JSONDecodeError as e:
|
|
178
|
+
logger.error(
|
|
179
|
+
f"Failed to decode JSON response for {func_name}"
|
|
180
|
+
)
|
|
181
|
+
return {"error": f"JSON decoding failed: {e!s}"}
|
|
182
|
+
except Exception as e:
|
|
183
|
+
logger.error(
|
|
184
|
+
f"Failed to execute function {func_name}: {e!s}"
|
|
185
|
+
)
|
|
186
|
+
return {"error": f"Execution failed: {e!s}"}
|
|
187
|
+
|
|
188
|
+
return wrapper
|
|
189
|
+
|
|
190
|
+
for func in funcs:
|
|
191
|
+
inner_func = func.func
|
|
192
|
+
func_name = func.get_function_name()
|
|
193
|
+
func_code = inspect.getsource(inner_func).strip()
|
|
194
|
+
|
|
195
|
+
func.func = make_wrapper(inner_func, func_name, func_code)
|
|
196
|
+
self.tools_map[func_name] = func
|
|
197
|
+
self.entrypoint[func_name] = entrypoint
|
|
198
|
+
|
|
199
|
+
return self
|
|
200
|
+
|
|
201
|
+
def info(self) -> str:
|
|
202
|
+
r"""Get information about the current sandbox.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
str: Information about the sandbox.
|
|
206
|
+
|
|
207
|
+
Raises:
|
|
208
|
+
RuntimeError: If the sandbox is not initialized.
|
|
209
|
+
"""
|
|
210
|
+
if self.sandbox is None:
|
|
211
|
+
raise RuntimeError("Failed to create sandbox.")
|
|
212
|
+
info = self.sandbox.info()
|
|
213
|
+
return (
|
|
214
|
+
f"Sandbox {info.name}:\n"
|
|
215
|
+
f"State: {info.state}\n"
|
|
216
|
+
f"Resources: {info.resources.cpu} CPU, {info.resources.memory} RAM"
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
def __del__(self):
|
|
220
|
+
r"""Clean up the sandbox when the object is deleted."""
|
|
221
|
+
if hasattr(self, 'sandbox'):
|
|
222
|
+
self._cleanup()
|
|
223
|
+
|
|
224
|
+
def stop(self) -> "DaytonaRuntime":
|
|
225
|
+
r"""Stop and remove the sandbox.
|
|
226
|
+
|
|
227
|
+
Returns:
|
|
228
|
+
DaytonaRuntime: The current runtime.
|
|
229
|
+
"""
|
|
230
|
+
self._cleanup()
|
|
231
|
+
return self
|
|
232
|
+
|
|
233
|
+
def reset(self) -> "DaytonaRuntime":
|
|
234
|
+
r"""Reset the sandbox by stopping and rebuilding it.
|
|
235
|
+
|
|
236
|
+
Returns:
|
|
237
|
+
DaytonaRuntime: The current runtime.
|
|
238
|
+
"""
|
|
239
|
+
return self.stop().build()
|
|
240
|
+
|
|
241
|
+
@property
|
|
242
|
+
def docs(self) -> str:
|
|
243
|
+
r"""Get the URL for the Daytona API documentation.
|
|
244
|
+
|
|
245
|
+
Returns:
|
|
246
|
+
str: The URL for the API documentation.
|
|
247
|
+
"""
|
|
248
|
+
return "https://www.daytona.io/docs/python-sdk/daytona/"
|