camel-ai 0.2.24__tar.gz → 0.2.25__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.24 → camel_ai-0.2.25}/PKG-INFO +1 -1
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/__init__.py +1 -1
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/sglang_config.py +7 -5
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/subprocess_interpreter.py +187 -46
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/sglang_model.py +35 -5
- {camel_ai-0.2.24 → camel_ai-0.2.25}/pyproject.toml +1 -1
- {camel_ai-0.2.24 → camel_ai-0.2.25}/.gitignore +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/LICENSE +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/README.md +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/_utils.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/apibank.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/apibench.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/gaia.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/nexus.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/data_collector/sharegpt_collector.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datahubs/huggingface.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datasets/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/environments/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/generators.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/human.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/docker_interpreter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/e2b_interpreter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/base_io.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/chunkr_reader.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/panda_reader.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/logger.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/context_creators/score_based.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/memories/records.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/conversation_models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/messages/func_message.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/aiml_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/anthropic_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/azure_openai_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/base_audio_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/base_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/cohere_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/deepseek_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/gemini_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/groq_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/internlm_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/litellm_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/mistral_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/model_factory.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/moonshot_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/nemotron_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/nvidia_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/ollama_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/openai_audio_models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/openai_compatible_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/openai_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/qwen_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reka_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/samba_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/siliconflow_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/stub_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/togetherai_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/vllm_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/yi_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/models/zhipuai_model.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/personas/persona.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/auto_retriever.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/api.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/docker_runtime.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/remote_http_runtime.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/graph_storages/neo4j_graph.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/key_value_storages/json.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/key_value_storages/redis.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/vectordb_storages/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/audio_analysis_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/dalle_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/excel_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/file_write_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/image_analysis_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/linkedin_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/mcp_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/networkx_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/search_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/slack_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/stripe_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/sympy_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/video_analysis_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/weather_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/web_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/toolkits/zapier_toolkit.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/enums.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/commons.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/verifiers/base.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/verifiers/models.py +0 -0
- {camel_ai-0.2.24 → camel_ai-0.2.25}/camel/verifiers/python_verifier.py +0 -0
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
|
-
from typing import Sequence, Union
|
|
16
|
+
from typing import Any, Dict, List, Optional, Sequence, Union
|
|
17
17
|
|
|
18
18
|
from camel.configs.base_config import BaseConfig
|
|
19
19
|
from camel.types import NOT_GIVEN, NotGiven
|
|
@@ -56,10 +56,11 @@ class SGLangConfig(BaseConfig):
|
|
|
56
56
|
in the chat completion. The total length of input tokens and
|
|
57
57
|
generated tokens is limited by the model's context length.
|
|
58
58
|
(default: :obj:`None`)
|
|
59
|
-
tools (list[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
tools (list[Dict[str, Any]], optional): A list of tool definitions
|
|
60
|
+
that the model can dynamically invoke. Each tool should be
|
|
61
|
+
defined as a dictionary following OpenAI's function calling
|
|
62
|
+
specification format. For more details, refer to the OpenAI
|
|
63
|
+
documentation.
|
|
63
64
|
"""
|
|
64
65
|
|
|
65
66
|
stop: Union[str, Sequence[str], NotGiven] = NOT_GIVEN
|
|
@@ -70,6 +71,7 @@ class SGLangConfig(BaseConfig):
|
|
|
70
71
|
presence_penalty: float = 0.0
|
|
71
72
|
stream: bool = False
|
|
72
73
|
max_tokens: Union[int, NotGiven] = NOT_GIVEN
|
|
74
|
+
tools: Optional[Union[List[Dict[str, Any]]]] = None
|
|
73
75
|
|
|
74
76
|
|
|
75
77
|
SGLANG_API_PARAMS = {param for param in SGLangConfig.model_fields.keys()}
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
|
|
15
|
-
import
|
|
15
|
+
import os
|
|
16
16
|
import subprocess
|
|
17
|
+
import sys
|
|
17
18
|
import tempfile
|
|
18
19
|
from pathlib import Path
|
|
19
20
|
from typing import Any, ClassVar, Dict, List
|
|
@@ -43,12 +44,14 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
43
44
|
the executed code. (default: :obj:`False`)
|
|
44
45
|
print_stderr (bool, optional): If True, print the standard error of the
|
|
45
46
|
executed code. (default: :obj:`True`)
|
|
47
|
+
execution_timeout (int, optional): Maximum time in seconds to wait for
|
|
48
|
+
code execution to complete. (default: :obj:`60`)
|
|
46
49
|
"""
|
|
47
50
|
|
|
48
|
-
_CODE_EXECUTE_CMD_MAPPING: ClassVar[Dict[str, str]] = {
|
|
49
|
-
"python": "python {file_name}",
|
|
50
|
-
"bash": "bash {file_name}",
|
|
51
|
-
"r": "Rscript {file_name}",
|
|
51
|
+
_CODE_EXECUTE_CMD_MAPPING: ClassVar[Dict[str, Dict[str, str]]] = {
|
|
52
|
+
"python": {"posix": "python {file_name}", "nt": "python {file_name}"},
|
|
53
|
+
"bash": {"posix": "bash {file_name}", "nt": "bash {file_name}"},
|
|
54
|
+
"r": {"posix": "Rscript {file_name}", "nt": "Rscript {file_name}"},
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
_CODE_EXTENSION_MAPPING: ClassVar[Dict[str, str]] = {
|
|
@@ -74,10 +77,12 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
74
77
|
require_confirm: bool = True,
|
|
75
78
|
print_stdout: bool = False,
|
|
76
79
|
print_stderr: bool = True,
|
|
80
|
+
execution_timeout: int = 60,
|
|
77
81
|
) -> None:
|
|
78
82
|
self.require_confirm = require_confirm
|
|
79
83
|
self.print_stdout = print_stdout
|
|
80
84
|
self.print_stderr = print_stderr
|
|
85
|
+
self.execution_timeout = execution_timeout
|
|
81
86
|
|
|
82
87
|
def run_file(
|
|
83
88
|
self,
|
|
@@ -94,13 +99,9 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
94
99
|
Returns:
|
|
95
100
|
str: A string containing the captured stdout and stderr of the
|
|
96
101
|
executed code.
|
|
97
|
-
|
|
98
|
-
Raises:
|
|
99
|
-
RuntimeError: If the provided file path does not point to a file.
|
|
100
|
-
InterpreterError: If the code type provided is not supported.
|
|
101
102
|
"""
|
|
102
103
|
if not file.is_file():
|
|
103
|
-
|
|
104
|
+
return f"{file} is not a file."
|
|
104
105
|
code_type = self._check_code_type(code_type)
|
|
105
106
|
if self._CODE_TYPE_MAPPING[code_type] == "python":
|
|
106
107
|
# For Python code, use ast to analyze and modify the code
|
|
@@ -108,7 +109,7 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
108
109
|
|
|
109
110
|
import astor
|
|
110
111
|
|
|
111
|
-
with open(file, 'r') as f:
|
|
112
|
+
with open(file, 'r', encoding='utf-8') as f:
|
|
112
113
|
source = f.read()
|
|
113
114
|
|
|
114
115
|
# Parse the source code
|
|
@@ -158,34 +159,88 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
158
159
|
modified_source = astor.to_source(tree)
|
|
159
160
|
# Create a temporary file with the modified source
|
|
160
161
|
temp_file = self._create_temp_file(modified_source, "py")
|
|
161
|
-
cmd =
|
|
162
|
-
except SyntaxError:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
162
|
+
cmd = ["python", str(temp_file)]
|
|
163
|
+
except (SyntaxError, TypeError, ValueError) as e:
|
|
164
|
+
logger.warning(f"Failed to parse Python code with AST: {e}")
|
|
165
|
+
platform_type = 'posix' if os.name != 'nt' else 'nt'
|
|
166
|
+
cmd_template = self._CODE_EXECUTE_CMD_MAPPING[code_type][
|
|
167
|
+
platform_type
|
|
168
|
+
]
|
|
169
|
+
base_cmd = cmd_template.split()[0]
|
|
170
|
+
|
|
171
|
+
# Check if command is available
|
|
172
|
+
if not self._is_command_available(base_cmd):
|
|
173
|
+
raise InterpreterError(
|
|
174
|
+
f"Command '{base_cmd}' not found. Please ensure it "
|
|
175
|
+
f"is installed and available in your PATH."
|
|
167
176
|
)
|
|
168
|
-
|
|
177
|
+
|
|
178
|
+
cmd = [base_cmd, str(file)]
|
|
169
179
|
else:
|
|
170
180
|
# For non-Python code, use standard execution
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
181
|
+
platform_type = 'posix' if os.name != 'nt' else 'nt'
|
|
182
|
+
cmd_template = self._CODE_EXECUTE_CMD_MAPPING[code_type][
|
|
183
|
+
platform_type
|
|
184
|
+
]
|
|
185
|
+
base_cmd = cmd_template.split()[0] # Get 'python', 'bash', etc.
|
|
186
|
+
|
|
187
|
+
# Check if command is available
|
|
188
|
+
if not self._is_command_available(base_cmd):
|
|
189
|
+
raise InterpreterError(
|
|
190
|
+
f"Command '{base_cmd}' not found. Please ensure it "
|
|
191
|
+
f"is installed and available in your PATH."
|
|
174
192
|
)
|
|
175
|
-
)
|
|
176
193
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
194
|
+
cmd = [base_cmd, str(file)]
|
|
195
|
+
|
|
196
|
+
# Get current Python executable's environment
|
|
197
|
+
env = os.environ.copy()
|
|
198
|
+
|
|
199
|
+
# On Windows, ensure we use the correct Python executable path
|
|
200
|
+
if os.name == 'nt':
|
|
201
|
+
python_path = os.path.dirname(sys.executable)
|
|
202
|
+
if 'PATH' in env:
|
|
203
|
+
env['PATH'] = python_path + os.pathsep + env['PATH']
|
|
204
|
+
else:
|
|
205
|
+
env['PATH'] = python_path
|
|
206
|
+
|
|
207
|
+
try:
|
|
208
|
+
proc = subprocess.Popen(
|
|
209
|
+
cmd,
|
|
210
|
+
stdout=subprocess.PIPE,
|
|
211
|
+
stderr=subprocess.PIPE,
|
|
212
|
+
text=True,
|
|
213
|
+
env=env,
|
|
214
|
+
shell=False, # Never use shell=True for security
|
|
215
|
+
)
|
|
216
|
+
# Add timeout to prevent hanging processes
|
|
217
|
+
stdout, stderr = proc.communicate(timeout=self.execution_timeout)
|
|
218
|
+
return_code = proc.returncode
|
|
219
|
+
except subprocess.TimeoutExpired:
|
|
220
|
+
proc.kill()
|
|
221
|
+
stdout, stderr = proc.communicate()
|
|
222
|
+
return_code = proc.returncode
|
|
223
|
+
timeout_msg = (
|
|
224
|
+
f"Process timed out after {self.execution_timeout} seconds "
|
|
225
|
+
f"and was terminated."
|
|
226
|
+
)
|
|
227
|
+
stderr = f"{stderr}\n{timeout_msg}"
|
|
182
228
|
|
|
183
229
|
# Clean up temporary file if it was created
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
230
|
+
temp_file_to_clean = locals().get('temp_file')
|
|
231
|
+
if temp_file_to_clean is not None:
|
|
232
|
+
try:
|
|
233
|
+
if temp_file_to_clean.exists():
|
|
234
|
+
try:
|
|
235
|
+
temp_file_to_clean.unlink()
|
|
236
|
+
except PermissionError:
|
|
237
|
+
# On Windows, files might be locked
|
|
238
|
+
logger.warning(
|
|
239
|
+
f"Could not delete temp file "
|
|
240
|
+
f"{temp_file_to_clean} (may be locked)"
|
|
241
|
+
)
|
|
242
|
+
except Exception as e:
|
|
243
|
+
logger.warning(f"Failed to cleanup temporary file: {e}")
|
|
189
244
|
|
|
190
245
|
if self.print_stdout and stdout:
|
|
191
246
|
print("======stdout======")
|
|
@@ -240,7 +295,7 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
240
295
|
"computer: {code}"
|
|
241
296
|
)
|
|
242
297
|
while True:
|
|
243
|
-
choice = input("Running code? [Y/n]:").lower()
|
|
298
|
+
choice = input("Running code? [Y/n]:").lower().strip()
|
|
244
299
|
if choice in ["y", "yes", "ye", ""]:
|
|
245
300
|
break
|
|
246
301
|
elif choice in ["no", "n"]:
|
|
@@ -249,22 +304,72 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
249
304
|
"This choice stops the current operation and any "
|
|
250
305
|
"further code execution."
|
|
251
306
|
)
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
307
|
+
else:
|
|
308
|
+
print("Please enter 'y' or 'n'.")
|
|
309
|
+
|
|
310
|
+
temp_file_path = None
|
|
311
|
+
temp_dir = None
|
|
312
|
+
try:
|
|
313
|
+
temp_file_path = self._create_temp_file(
|
|
314
|
+
code=code, extension=self._CODE_EXTENSION_MAPPING[code_type]
|
|
315
|
+
)
|
|
316
|
+
temp_dir = temp_file_path.parent
|
|
317
|
+
return self.run_file(temp_file_path, code_type)
|
|
318
|
+
finally:
|
|
319
|
+
# Clean up temp file and directory
|
|
320
|
+
try:
|
|
321
|
+
if temp_file_path and temp_file_path.exists():
|
|
322
|
+
try:
|
|
323
|
+
temp_file_path.unlink()
|
|
324
|
+
except PermissionError:
|
|
325
|
+
# On Windows, files might be locked
|
|
326
|
+
logger.warning(
|
|
327
|
+
f"Could not delete temp file {temp_file_path}"
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
if temp_dir and temp_dir.exists():
|
|
331
|
+
try:
|
|
332
|
+
import shutil
|
|
333
|
+
|
|
334
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
335
|
+
except Exception as e:
|
|
336
|
+
logger.warning(f"Could not delete temp directory: {e}")
|
|
337
|
+
except Exception as e:
|
|
338
|
+
logger.warning(f"Error during cleanup: {e}")
|
|
255
339
|
|
|
256
|
-
|
|
340
|
+
def _create_temp_file(self, code: str, extension: str) -> Path:
|
|
341
|
+
r"""Creates a temporary file with the given code and extension.
|
|
257
342
|
|
|
258
|
-
|
|
259
|
-
|
|
343
|
+
Args:
|
|
344
|
+
code (str): The code to write to the temporary file.
|
|
345
|
+
extension (str): The file extension to use.
|
|
260
346
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
347
|
+
Returns:
|
|
348
|
+
Path: The path to the created temporary file.
|
|
349
|
+
"""
|
|
350
|
+
try:
|
|
351
|
+
# Create a temporary directory first to ensure we have write
|
|
352
|
+
# permissions
|
|
353
|
+
temp_dir = tempfile.mkdtemp()
|
|
354
|
+
# Create file path with appropriate extension
|
|
355
|
+
file_path = Path(temp_dir) / f"temp_code.{extension}"
|
|
356
|
+
|
|
357
|
+
# Write code to file with appropriate encoding
|
|
358
|
+
with open(file_path, 'w', encoding='utf-8') as f:
|
|
359
|
+
f.write(code)
|
|
360
|
+
|
|
361
|
+
return file_path
|
|
362
|
+
except Exception as e:
|
|
363
|
+
# Clean up temp directory if creation failed
|
|
364
|
+
if 'temp_dir' in locals():
|
|
365
|
+
try:
|
|
366
|
+
import shutil
|
|
367
|
+
|
|
368
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
369
|
+
except Exception:
|
|
370
|
+
pass
|
|
371
|
+
logger.error(f"Failed to create temporary file: {e}")
|
|
372
|
+
raise
|
|
268
373
|
|
|
269
374
|
def _check_code_type(self, code_type: str) -> str:
|
|
270
375
|
if code_type not in self._CODE_TYPE_MAPPING:
|
|
@@ -284,3 +389,39 @@ class SubprocessInterpreter(BaseInterpreter):
|
|
|
284
389
|
raise RuntimeError(
|
|
285
390
|
"SubprocessInterpreter doesn't support " "`action_space`."
|
|
286
391
|
)
|
|
392
|
+
|
|
393
|
+
def _is_command_available(self, command: str) -> bool:
|
|
394
|
+
r"""Check if a command is available in the system PATH.
|
|
395
|
+
|
|
396
|
+
Args:
|
|
397
|
+
command (str): The command to check.
|
|
398
|
+
|
|
399
|
+
Returns:
|
|
400
|
+
bool: True if the command is available, False otherwise.
|
|
401
|
+
"""
|
|
402
|
+
if os.name == 'nt': # Windows
|
|
403
|
+
# On Windows, use where.exe to find the command
|
|
404
|
+
try:
|
|
405
|
+
with open(os.devnull, 'w') as devnull:
|
|
406
|
+
subprocess.check_call(
|
|
407
|
+
['where', command],
|
|
408
|
+
stdout=devnull,
|
|
409
|
+
stderr=devnull,
|
|
410
|
+
shell=False,
|
|
411
|
+
)
|
|
412
|
+
return True
|
|
413
|
+
except subprocess.CalledProcessError:
|
|
414
|
+
return False
|
|
415
|
+
else: # Unix-like systems
|
|
416
|
+
# On Unix-like systems, use which to find the command
|
|
417
|
+
try:
|
|
418
|
+
with open(os.devnull, 'w') as devnull:
|
|
419
|
+
subprocess.check_call(
|
|
420
|
+
['which', command],
|
|
421
|
+
stdout=devnull,
|
|
422
|
+
stderr=devnull,
|
|
423
|
+
shell=False,
|
|
424
|
+
)
|
|
425
|
+
return True
|
|
426
|
+
except subprocess.CalledProcessError:
|
|
427
|
+
return False
|
|
@@ -97,9 +97,16 @@ class SGLangModel(BaseModelBackend):
|
|
|
97
97
|
def _start_server(self) -> None:
|
|
98
98
|
try:
|
|
99
99
|
if not self._url:
|
|
100
|
+
tool_call_flag = self.model_config_dict.get("tools")
|
|
101
|
+
tool_call_arg = (
|
|
102
|
+
f"--tool-call-parser {self._api_key} "
|
|
103
|
+
if tool_call_flag
|
|
104
|
+
else ""
|
|
105
|
+
)
|
|
100
106
|
cmd = (
|
|
101
107
|
f"python -m sglang.launch_server "
|
|
102
108
|
f"--model-path {self.model_type} "
|
|
109
|
+
f"{tool_call_arg}"
|
|
103
110
|
f"--port 30000 "
|
|
104
111
|
f"--host 0.0.0.0"
|
|
105
112
|
)
|
|
@@ -265,6 +272,19 @@ class SGLangModel(BaseModelBackend):
|
|
|
265
272
|
"""
|
|
266
273
|
return self.model_config_dict.get('stream', False)
|
|
267
274
|
|
|
275
|
+
def __del__(self):
|
|
276
|
+
r"""Properly clean up resources when the model is destroyed."""
|
|
277
|
+
self.cleanup()
|
|
278
|
+
|
|
279
|
+
def cleanup(self):
|
|
280
|
+
r"""Terminate the server process and clean up resources."""
|
|
281
|
+
with self._lock:
|
|
282
|
+
if self.server_process:
|
|
283
|
+
_terminate_process(self.server_process)
|
|
284
|
+
self.server_process = None
|
|
285
|
+
self._client = None
|
|
286
|
+
logging.info("Server process terminated during cleanup.")
|
|
287
|
+
|
|
268
288
|
|
|
269
289
|
# Below are helper functions from sglang.utils
|
|
270
290
|
def _terminate_process(process):
|
|
@@ -326,21 +346,25 @@ def _execute_shell_command(command: str) -> subprocess.Popen:
|
|
|
326
346
|
return subprocess.Popen(parts, text=True, stderr=subprocess.STDOUT)
|
|
327
347
|
|
|
328
348
|
|
|
329
|
-
def _wait_for_server(base_url: str, timeout: Optional[int] =
|
|
349
|
+
def _wait_for_server(base_url: str, timeout: Optional[int] = 30) -> None:
|
|
330
350
|
r"""Wait for the server to be ready by polling the /v1/models endpoint.
|
|
331
351
|
|
|
332
352
|
Args:
|
|
333
353
|
base_url: The base URL of the server
|
|
334
|
-
timeout: Maximum time to wait in seconds.
|
|
354
|
+
timeout: Maximum time to wait in seconds. Default is 30 seconds.
|
|
335
355
|
"""
|
|
336
356
|
import requests
|
|
337
357
|
|
|
358
|
+
# Set a default value if timeout is None
|
|
359
|
+
actual_timeout = 30 if timeout is None else timeout
|
|
360
|
+
|
|
338
361
|
start_time = time.time()
|
|
339
362
|
while True:
|
|
340
363
|
try:
|
|
341
364
|
response = requests.get(
|
|
342
365
|
f"{base_url}/v1/models",
|
|
343
366
|
headers={"Authorization": "Bearer None"},
|
|
367
|
+
timeout=5, # Add a timeout for the request itself
|
|
344
368
|
)
|
|
345
369
|
if response.status_code == 200:
|
|
346
370
|
time.sleep(5)
|
|
@@ -356,9 +380,15 @@ def _wait_for_server(base_url: str, timeout: Optional[int] = None) -> None:
|
|
|
356
380
|
)
|
|
357
381
|
break
|
|
358
382
|
|
|
359
|
-
if
|
|
383
|
+
if time.time() - start_time > actual_timeout:
|
|
384
|
+
raise TimeoutError(
|
|
385
|
+
f"Server did not become ready within "
|
|
386
|
+
f"{actual_timeout} seconds"
|
|
387
|
+
)
|
|
388
|
+
except (requests.exceptions.RequestException, TimeoutError) as e:
|
|
389
|
+
if time.time() - start_time > actual_timeout:
|
|
360
390
|
raise TimeoutError(
|
|
361
|
-
"Server did not become ready within
|
|
391
|
+
f"Server did not become ready within "
|
|
392
|
+
f"{actual_timeout} seconds: {e}"
|
|
362
393
|
)
|
|
363
|
-
except requests.exceptions.RequestException:
|
|
364
394
|
time.sleep(1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{camel_ai-0.2.24 → camel_ai-0.2.25}/camel/datagen/self_instruct/filter/instruction_filter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|