camel-ai 0.2.26__tar.gz → 0.2.28__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.26 → camel_ai-0.2.28}/PKG-INFO +1 -1
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/__init__.py +1 -1
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/__init__.py +4 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/azure_openai_model.py +90 -9
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/model_factory.py +3 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/openai_compatible_model.py +88 -8
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/sglang_model.py +3 -2
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/vllm_model.py +22 -2
- camel_ai-0.2.28/camel/models/volcano_model.py +100 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/graph_storages/neo4j_graph.py +10 -8
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/__init__.py +3 -2
- camel_ai-0.2.26/camel/toolkits/web_toolkit.py → camel_ai-0.2.28/camel/toolkits/browser_toolkit.py +143 -76
- camel_ai-0.2.28/camel/toolkits/mcp_toolkit.py +509 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/search_toolkit.py +63 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/enums.py +7 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/pyproject.toml +1 -1
- camel_ai-0.2.26/camel/toolkits/mcp_toolkit.py +0 -251
- {camel_ai-0.2.26 → camel_ai-0.2.28}/.gitignore +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/LICENSE +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/README.md +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/_utils.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/apibank.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/apibench.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/gaia.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/nexus.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/sglang_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/data_collector/sharegpt_collector.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datahubs/huggingface.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/datasets/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/environments/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/extractors/python_strategies.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/generators.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/human.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/docker_interpreter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/e2b_interpreter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/interpreters/subprocess_interpreter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/base_io.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/chunkr_reader.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/panda_reader.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/logger.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/context_creators/score_based.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/memories/records.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/conversation_models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/messages/func_message.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/aiml_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/anthropic_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/base_audio_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/base_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/cohere_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/deepseek_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/gemini_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/groq_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/internlm_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/litellm_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/mistral_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/moonshot_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/nemotron_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/nvidia_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/ollama_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/openai_audio_models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/openai_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/qwen_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reka_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/samba_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/siliconflow_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/stub_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/togetherai_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/yi_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/models/zhipuai_model.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/personas/persona.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/py.typed +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/auto_retriever.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/api.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/docker_runtime.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/remote_http_runtime.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/key_value_storages/json.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/key_value_storages/redis.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/vectordb_storages/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/audio_analysis_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/dalle_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/excel_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/file_write_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/image_analysis_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/linkedin_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/networkx_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/pubmed_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/semantic_scholar_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/slack_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/stripe_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/sympy_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/video_analysis_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/weather_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/toolkits/zapier_toolkit.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/commons.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/verifiers/base.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/verifiers/models.py +0 -0
- {camel_ai-0.2.26 → camel_ai-0.2.28}/camel/verifiers/python_verifier.py +0 -0
|
@@ -37,9 +37,11 @@ from .qwen_model import QwenModel
|
|
|
37
37
|
from .reka_model import RekaModel
|
|
38
38
|
from .samba_model import SambaModel
|
|
39
39
|
from .sglang_model import SGLangModel
|
|
40
|
+
from .siliconflow_model import SiliconFlowModel
|
|
40
41
|
from .stub_model import StubModel
|
|
41
42
|
from .togetherai_model import TogetherAIModel
|
|
42
43
|
from .vllm_model import VLLMModel
|
|
44
|
+
from .volcano_model import VolcanoModel
|
|
43
45
|
from .yi_model import YiModel
|
|
44
46
|
from .zhipuai_model import ZhipuAIModel
|
|
45
47
|
|
|
@@ -76,4 +78,6 @@ __all__ = [
|
|
|
76
78
|
'MoonshotModel',
|
|
77
79
|
'AIMLModel',
|
|
78
80
|
'BaseAudioModel',
|
|
81
|
+
'SiliconFlowModel',
|
|
82
|
+
'VolcanoModel',
|
|
79
83
|
]
|
|
@@ -128,18 +128,23 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
128
128
|
Args:
|
|
129
129
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
130
130
|
in OpenAI API format.
|
|
131
|
+
response_format (Optional[Type[BaseModel]]): The format of the
|
|
132
|
+
response.
|
|
133
|
+
tools (Optional[List[Dict[str, Any]]]): The schema of the tools to
|
|
134
|
+
use for the request.
|
|
131
135
|
|
|
132
136
|
Returns:
|
|
133
137
|
Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
134
138
|
`ChatCompletion` in the non-stream mode, or
|
|
135
139
|
`Stream[ChatCompletionChunk]` in the stream mode.
|
|
136
140
|
"""
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
model=self.azure_deployment_name, # type:ignore[arg-type]
|
|
140
|
-
**self.model_config_dict,
|
|
141
|
+
response_format = response_format or self.model_config_dict.get(
|
|
142
|
+
"response_format", None
|
|
141
143
|
)
|
|
142
|
-
|
|
144
|
+
if response_format:
|
|
145
|
+
return self._request_parse(messages, response_format, tools)
|
|
146
|
+
else:
|
|
147
|
+
return self._request_chat_completion(messages, tools)
|
|
143
148
|
|
|
144
149
|
async def _arun(
|
|
145
150
|
self,
|
|
@@ -152,18 +157,93 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
152
157
|
Args:
|
|
153
158
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
154
159
|
in OpenAI API format.
|
|
160
|
+
response_format (Optional[Type[BaseModel]]): The format of the
|
|
161
|
+
response.
|
|
162
|
+
tools (Optional[List[Dict[str, Any]]]): The schema of the tools to
|
|
163
|
+
use for the request.
|
|
155
164
|
|
|
156
165
|
Returns:
|
|
157
166
|
Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
|
|
158
167
|
`ChatCompletion` in the non-stream mode, or
|
|
159
168
|
`AsyncStream[ChatCompletionChunk]` in the stream mode.
|
|
160
169
|
"""
|
|
161
|
-
|
|
170
|
+
response_format = response_format or self.model_config_dict.get(
|
|
171
|
+
"response_format", None
|
|
172
|
+
)
|
|
173
|
+
if response_format:
|
|
174
|
+
return await self._arequest_parse(messages, response_format, tools)
|
|
175
|
+
else:
|
|
176
|
+
return await self._arequest_chat_completion(messages, tools)
|
|
177
|
+
|
|
178
|
+
def _request_chat_completion(
|
|
179
|
+
self,
|
|
180
|
+
messages: List[OpenAIMessage],
|
|
181
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
182
|
+
) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
183
|
+
request_config = self.model_config_dict.copy()
|
|
184
|
+
|
|
185
|
+
if tools:
|
|
186
|
+
request_config["tools"] = tools
|
|
187
|
+
|
|
188
|
+
return self._client.chat.completions.create(
|
|
189
|
+
messages=messages,
|
|
190
|
+
model=self.azure_deployment_name, # type:ignore[arg-type]
|
|
191
|
+
**request_config,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
async def _arequest_chat_completion(
|
|
195
|
+
self,
|
|
196
|
+
messages: List[OpenAIMessage],
|
|
197
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
198
|
+
) -> Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
|
|
199
|
+
request_config = self.model_config_dict.copy()
|
|
200
|
+
|
|
201
|
+
if tools:
|
|
202
|
+
request_config["tools"] = tools
|
|
203
|
+
|
|
204
|
+
return await self._async_client.chat.completions.create(
|
|
162
205
|
messages=messages,
|
|
163
206
|
model=self.azure_deployment_name, # type:ignore[arg-type]
|
|
164
|
-
**
|
|
207
|
+
**request_config,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
def _request_parse(
|
|
211
|
+
self,
|
|
212
|
+
messages: List[OpenAIMessage],
|
|
213
|
+
response_format: Type[BaseModel],
|
|
214
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
215
|
+
) -> ChatCompletion:
|
|
216
|
+
request_config = self.model_config_dict.copy()
|
|
217
|
+
|
|
218
|
+
request_config["response_format"] = response_format
|
|
219
|
+
request_config.pop("stream", None)
|
|
220
|
+
if tools is not None:
|
|
221
|
+
request_config["tools"] = tools
|
|
222
|
+
|
|
223
|
+
return self._client.beta.chat.completions.parse(
|
|
224
|
+
messages=messages,
|
|
225
|
+
model=self.azure_deployment_name, # type:ignore[arg-type]
|
|
226
|
+
**request_config,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
async def _arequest_parse(
|
|
230
|
+
self,
|
|
231
|
+
messages: List[OpenAIMessage],
|
|
232
|
+
response_format: Type[BaseModel],
|
|
233
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
234
|
+
) -> ChatCompletion:
|
|
235
|
+
request_config = self.model_config_dict.copy()
|
|
236
|
+
|
|
237
|
+
request_config["response_format"] = response_format
|
|
238
|
+
request_config.pop("stream", None)
|
|
239
|
+
if tools is not None:
|
|
240
|
+
request_config["tools"] = tools
|
|
241
|
+
|
|
242
|
+
return await self._async_client.beta.chat.completions.parse(
|
|
243
|
+
messages=messages,
|
|
244
|
+
model=self.azure_deployment_name, # type:ignore[arg-type]
|
|
245
|
+
**request_config,
|
|
165
246
|
)
|
|
166
|
-
return response
|
|
167
247
|
|
|
168
248
|
def check_model_config(self):
|
|
169
249
|
r"""Check whether the model configuration contains any
|
|
@@ -183,7 +263,8 @@ class AzureOpenAIModel(BaseModelBackend):
|
|
|
183
263
|
@property
|
|
184
264
|
def stream(self) -> bool:
|
|
185
265
|
r"""Returns whether the model is in stream mode,
|
|
186
|
-
|
|
266
|
+
which sends partial results each time.
|
|
267
|
+
|
|
187
268
|
Returns:
|
|
188
269
|
bool: Whether the model is in stream mode.
|
|
189
270
|
"""
|
|
@@ -37,6 +37,7 @@ from camel.models.siliconflow_model import SiliconFlowModel
|
|
|
37
37
|
from camel.models.stub_model import StubModel
|
|
38
38
|
from camel.models.togetherai_model import TogetherAIModel
|
|
39
39
|
from camel.models.vllm_model import VLLMModel
|
|
40
|
+
from camel.models.volcano_model import VolcanoModel
|
|
40
41
|
from camel.models.yi_model import YiModel
|
|
41
42
|
from camel.models.zhipuai_model import ZhipuAIModel
|
|
42
43
|
from camel.types import ModelPlatformType, ModelType, UnifiedModelType
|
|
@@ -107,6 +108,8 @@ class ModelFactory:
|
|
|
107
108
|
model_class = SiliconFlowModel
|
|
108
109
|
elif model_platform.is_aiml:
|
|
109
110
|
model_class = AIMLModel
|
|
111
|
+
elif model_platform.is_volcano:
|
|
112
|
+
model_class = VolcanoModel
|
|
110
113
|
|
|
111
114
|
elif model_platform.is_openai and model_type.is_openai:
|
|
112
115
|
model_class = OpenAIModel
|
|
@@ -86,18 +86,23 @@ class OpenAICompatibleModel(BaseModelBackend):
|
|
|
86
86
|
Args:
|
|
87
87
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
88
88
|
in OpenAI API format.
|
|
89
|
+
response_format (Optional[Type[BaseModel]]): The format of the
|
|
90
|
+
response.
|
|
91
|
+
tools (Optional[List[Dict[str, Any]]]): The schema of the tools to
|
|
92
|
+
use for the request.
|
|
89
93
|
|
|
90
94
|
Returns:
|
|
91
95
|
Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
92
96
|
`ChatCompletion` in the non-stream mode, or
|
|
93
97
|
`Stream[ChatCompletionChunk]` in the stream mode.
|
|
94
98
|
"""
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
model=self.model_type,
|
|
98
|
-
**self.model_config_dict,
|
|
99
|
+
response_format = response_format or self.model_config_dict.get(
|
|
100
|
+
"response_format", None
|
|
99
101
|
)
|
|
100
|
-
|
|
102
|
+
if response_format:
|
|
103
|
+
return self._request_parse(messages, response_format, tools)
|
|
104
|
+
else:
|
|
105
|
+
return self._request_chat_completion(messages, tools)
|
|
101
106
|
|
|
102
107
|
async def _arun(
|
|
103
108
|
self,
|
|
@@ -110,18 +115,93 @@ class OpenAICompatibleModel(BaseModelBackend):
|
|
|
110
115
|
Args:
|
|
111
116
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
112
117
|
in OpenAI API format.
|
|
118
|
+
response_format (Optional[Type[BaseModel]]): The format of the
|
|
119
|
+
response.
|
|
120
|
+
tools (Optional[List[Dict[str, Any]]]): The schema of the tools to
|
|
121
|
+
use for the request.
|
|
113
122
|
|
|
114
123
|
Returns:
|
|
115
124
|
Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
|
|
116
125
|
`ChatCompletion` in the non-stream mode, or
|
|
117
126
|
`AsyncStream[ChatCompletionChunk]` in the stream mode.
|
|
118
127
|
"""
|
|
119
|
-
|
|
128
|
+
response_format = response_format or self.model_config_dict.get(
|
|
129
|
+
"response_format", None
|
|
130
|
+
)
|
|
131
|
+
if response_format:
|
|
132
|
+
return await self._arequest_parse(messages, response_format, tools)
|
|
133
|
+
else:
|
|
134
|
+
return await self._arequest_chat_completion(messages, tools)
|
|
135
|
+
|
|
136
|
+
def _request_chat_completion(
|
|
137
|
+
self,
|
|
138
|
+
messages: List[OpenAIMessage],
|
|
139
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
140
|
+
) -> Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
141
|
+
request_config = self.model_config_dict.copy()
|
|
142
|
+
|
|
143
|
+
if tools:
|
|
144
|
+
request_config["tools"] = tools
|
|
145
|
+
|
|
146
|
+
return self._client.chat.completions.create(
|
|
147
|
+
messages=messages,
|
|
148
|
+
model=self.model_type,
|
|
149
|
+
**request_config,
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
async def _arequest_chat_completion(
|
|
153
|
+
self,
|
|
154
|
+
messages: List[OpenAIMessage],
|
|
155
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
156
|
+
) -> Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
|
|
157
|
+
request_config = self.model_config_dict.copy()
|
|
158
|
+
|
|
159
|
+
if tools:
|
|
160
|
+
request_config["tools"] = tools
|
|
161
|
+
|
|
162
|
+
return await self._async_client.chat.completions.create(
|
|
163
|
+
messages=messages,
|
|
164
|
+
model=self.model_type,
|
|
165
|
+
**request_config,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
def _request_parse(
|
|
169
|
+
self,
|
|
170
|
+
messages: List[OpenAIMessage],
|
|
171
|
+
response_format: Type[BaseModel],
|
|
172
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
173
|
+
) -> ChatCompletion:
|
|
174
|
+
request_config = self.model_config_dict.copy()
|
|
175
|
+
|
|
176
|
+
request_config["response_format"] = response_format
|
|
177
|
+
request_config.pop("stream", None)
|
|
178
|
+
if tools is not None:
|
|
179
|
+
request_config["tools"] = tools
|
|
180
|
+
|
|
181
|
+
return self._client.beta.chat.completions.parse(
|
|
182
|
+
messages=messages,
|
|
183
|
+
model=self.model_type,
|
|
184
|
+
**request_config,
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
async def _arequest_parse(
|
|
188
|
+
self,
|
|
189
|
+
messages: List[OpenAIMessage],
|
|
190
|
+
response_format: Type[BaseModel],
|
|
191
|
+
tools: Optional[List[Dict[str, Any]]] = None,
|
|
192
|
+
) -> ChatCompletion:
|
|
193
|
+
request_config = self.model_config_dict.copy()
|
|
194
|
+
|
|
195
|
+
request_config["response_format"] = response_format
|
|
196
|
+
request_config.pop("stream", None)
|
|
197
|
+
if tools is not None:
|
|
198
|
+
request_config["tools"] = tools
|
|
199
|
+
|
|
200
|
+
return await self._async_client.beta.chat.completions.parse(
|
|
120
201
|
messages=messages,
|
|
121
202
|
model=self.model_type,
|
|
122
|
-
**
|
|
203
|
+
**request_config,
|
|
123
204
|
)
|
|
124
|
-
return response
|
|
125
205
|
|
|
126
206
|
@property
|
|
127
207
|
def token_counter(self) -> BaseTokenCounter:
|
|
@@ -350,8 +350,9 @@ def _wait_for_server(base_url: str, timeout: Optional[int] = 30) -> None:
|
|
|
350
350
|
r"""Wait for the server to be ready by polling the /v1/models endpoint.
|
|
351
351
|
|
|
352
352
|
Args:
|
|
353
|
-
base_url: The base URL of the server
|
|
354
|
-
timeout: Maximum time to wait in seconds.
|
|
353
|
+
base_url (str): The base URL of the server
|
|
354
|
+
timeout (Optional[int]): Maximum time to wait in seconds.
|
|
355
|
+
(default: :obj:`30`)
|
|
355
356
|
"""
|
|
356
357
|
import requests
|
|
357
358
|
|
|
@@ -139,6 +139,10 @@ class VLLMModel(BaseModelBackend):
|
|
|
139
139
|
Args:
|
|
140
140
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
141
141
|
in OpenAI API format.
|
|
142
|
+
response_format (Optional[Type[BaseModel]], optional): The format
|
|
143
|
+
to return the response in.
|
|
144
|
+
tools (Optional[List[Dict[str, Any]]], optional): List of tools
|
|
145
|
+
the model may call.
|
|
142
146
|
|
|
143
147
|
Returns:
|
|
144
148
|
Union[ChatCompletion, AsyncStream[ChatCompletionChunk]]:
|
|
@@ -146,10 +150,16 @@ class VLLMModel(BaseModelBackend):
|
|
|
146
150
|
`AsyncStream[ChatCompletionChunk]` in the stream mode.
|
|
147
151
|
"""
|
|
148
152
|
|
|
153
|
+
kwargs = self.model_config_dict.copy()
|
|
154
|
+
if tools:
|
|
155
|
+
kwargs["tools"] = tools
|
|
156
|
+
if response_format:
|
|
157
|
+
kwargs["response_format"] = {"type": "json_object"}
|
|
158
|
+
|
|
149
159
|
response = await self._async_client.chat.completions.create(
|
|
150
160
|
messages=messages,
|
|
151
161
|
model=self.model_type,
|
|
152
|
-
**
|
|
162
|
+
**kwargs,
|
|
153
163
|
)
|
|
154
164
|
return response
|
|
155
165
|
|
|
@@ -164,6 +174,10 @@ class VLLMModel(BaseModelBackend):
|
|
|
164
174
|
Args:
|
|
165
175
|
messages (List[OpenAIMessage]): Message list with the chat history
|
|
166
176
|
in OpenAI API format.
|
|
177
|
+
response_format (Optional[Type[BaseModel]], optional): The format
|
|
178
|
+
to return the response in.
|
|
179
|
+
tools (Optional[List[Dict[str, Any]]], optional): List of tools
|
|
180
|
+
the model may call.
|
|
167
181
|
|
|
168
182
|
Returns:
|
|
169
183
|
Union[ChatCompletion, Stream[ChatCompletionChunk]]:
|
|
@@ -171,10 +185,16 @@ class VLLMModel(BaseModelBackend):
|
|
|
171
185
|
`Stream[ChatCompletionChunk]` in the stream mode.
|
|
172
186
|
"""
|
|
173
187
|
|
|
188
|
+
kwargs = self.model_config_dict.copy()
|
|
189
|
+
if tools:
|
|
190
|
+
kwargs["tools"] = tools
|
|
191
|
+
if response_format:
|
|
192
|
+
kwargs["response_format"] = {"type": "json_object"}
|
|
193
|
+
|
|
174
194
|
response = self._client.chat.completions.create(
|
|
175
195
|
messages=messages,
|
|
176
196
|
model=self.model_type,
|
|
177
|
-
**
|
|
197
|
+
**kwargs,
|
|
178
198
|
)
|
|
179
199
|
return response
|
|
180
200
|
|
|
@@ -0,0 +1,100 @@
|
|
|
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 os
|
|
16
|
+
from typing import Any, Dict, Optional, Union
|
|
17
|
+
|
|
18
|
+
from camel.configs import OPENAI_API_PARAMS
|
|
19
|
+
from camel.models.openai_compatible_model import OpenAICompatibleModel
|
|
20
|
+
from camel.types import ModelType
|
|
21
|
+
from camel.utils import (
|
|
22
|
+
BaseTokenCounter,
|
|
23
|
+
OpenAITokenCounter,
|
|
24
|
+
api_keys_required,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class VolcanoModel(OpenAICompatibleModel):
|
|
29
|
+
r"""Volcano Engine API in a unified BaseModelBackend interface.
|
|
30
|
+
|
|
31
|
+
Args:
|
|
32
|
+
model_type (Union[ModelType, str]): Model for which a backend is
|
|
33
|
+
created.
|
|
34
|
+
model_config_dict (Optional[Dict[str, Any]], optional): A dictionary
|
|
35
|
+
that will be fed into the API call. If
|
|
36
|
+
:obj:`None`, :obj:`{}` will be used. (default: :obj:`None`)
|
|
37
|
+
api_key (Optional[str], optional): The API key for authenticating with
|
|
38
|
+
the Volcano Engine service. (default: :obj:`None`)
|
|
39
|
+
url (Optional[str], optional): The url to the Volcano Engine service.
|
|
40
|
+
(default: :obj:`https://ark.cn-beijing.volces.com/api/v3`)
|
|
41
|
+
token_counter (Optional[BaseTokenCounter], optional): Token counter to
|
|
42
|
+
use for the model. If not provided, :obj:`OpenAITokenCounter`
|
|
43
|
+
will be used. (default: :obj:`None`)
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
@api_keys_required(
|
|
47
|
+
[
|
|
48
|
+
("api_key", "VOLCANO_API_KEY"),
|
|
49
|
+
]
|
|
50
|
+
)
|
|
51
|
+
def __init__(
|
|
52
|
+
self,
|
|
53
|
+
model_type: Union[ModelType, str],
|
|
54
|
+
model_config_dict: Optional[Dict[str, Any]] = None,
|
|
55
|
+
api_key: Optional[str] = None,
|
|
56
|
+
url: Optional[str] = None,
|
|
57
|
+
token_counter: Optional[BaseTokenCounter] = None,
|
|
58
|
+
) -> None:
|
|
59
|
+
if model_config_dict is None:
|
|
60
|
+
model_config_dict = {}
|
|
61
|
+
|
|
62
|
+
api_key = api_key or os.environ.get("VOLCANO_API_KEY")
|
|
63
|
+
url = (
|
|
64
|
+
url
|
|
65
|
+
or os.environ.get("VOLCANO_API_BASE_URL")
|
|
66
|
+
or "https://ark.cn-beijing.volces.com/api/v3"
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
super().__init__(
|
|
70
|
+
model_type, model_config_dict, api_key, url, token_counter
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def token_counter(self) -> BaseTokenCounter:
|
|
75
|
+
r"""Initialize the token counter for the model backend.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
BaseTokenCounter: The token counter following the model's
|
|
79
|
+
tokenization style.
|
|
80
|
+
"""
|
|
81
|
+
if not self._token_counter:
|
|
82
|
+
# Use OpenAI token counter as an approximation
|
|
83
|
+
self._token_counter = OpenAITokenCounter(ModelType.GPT_4O_MINI)
|
|
84
|
+
return self._token_counter
|
|
85
|
+
|
|
86
|
+
def check_model_config(self):
|
|
87
|
+
r"""Check whether the model configuration is valid for Volcano
|
|
88
|
+
model backends.
|
|
89
|
+
|
|
90
|
+
Raises:
|
|
91
|
+
ValueError: If the model configuration dictionary contains any
|
|
92
|
+
unexpected arguments to Volcano API.
|
|
93
|
+
"""
|
|
94
|
+
# Using OpenAI API params as Volcano Engine API is OpenAI-compatible
|
|
95
|
+
for param in self.model_config_dict:
|
|
96
|
+
if param not in OPENAI_API_PARAMS:
|
|
97
|
+
raise ValueError(
|
|
98
|
+
f"Unexpected argument `{param}` is "
|
|
99
|
+
"input into Volcano model backend."
|
|
100
|
+
)
|
|
@@ -343,14 +343,14 @@ class Neo4jGraph(BaseGraphStorage):
|
|
|
343
343
|
self, subj: str, obj: str, rel: str, timestamp: Optional[str] = None
|
|
344
344
|
) -> None:
|
|
345
345
|
r"""Adds a relationship (triplet) between two entities
|
|
346
|
-
|
|
346
|
+
in the database with a timestamp.
|
|
347
347
|
|
|
348
348
|
Args:
|
|
349
349
|
subj (str): The identifier for the subject entity.
|
|
350
350
|
obj (str): The identifier for the object entity.
|
|
351
351
|
rel (str): The relationship between the subject and object.
|
|
352
352
|
timestamp (Optional[str]): The timestamp of the relationship.
|
|
353
|
-
|
|
353
|
+
Defaults to None.
|
|
354
354
|
"""
|
|
355
355
|
query = """
|
|
356
356
|
MERGE (n1:`%s` {id:$subj})
|
|
@@ -737,21 +737,23 @@ class Neo4jGraph(BaseGraphStorage):
|
|
|
737
737
|
obj: Optional[str] = None,
|
|
738
738
|
rel: Optional[str] = None,
|
|
739
739
|
) -> List[Dict[str, Any]]:
|
|
740
|
-
r"""
|
|
741
|
-
Query triplet information. If subj, obj, or rel is
|
|
740
|
+
r"""Query triplet information. If subj, obj, or rel is
|
|
742
741
|
not specified, returns all matching triplets.
|
|
743
742
|
|
|
744
743
|
Args:
|
|
745
744
|
subj (Optional[str]): The ID of the subject node.
|
|
746
|
-
|
|
745
|
+
If None, matches any subject node.
|
|
746
|
+
(default: :obj:`None`)
|
|
747
747
|
obj (Optional[str]): The ID of the object node.
|
|
748
|
-
|
|
748
|
+
If None, matches any object node.
|
|
749
|
+
(default: :obj:`None`)
|
|
749
750
|
rel (Optional[str]): The type of relationship.
|
|
750
|
-
|
|
751
|
+
If None, matches any relationship type.
|
|
752
|
+
(default: :obj:`None`)
|
|
751
753
|
|
|
752
754
|
Returns:
|
|
753
755
|
List[Dict[str, Any]]: A list of matching triplets,
|
|
754
|
-
|
|
756
|
+
each containing subj, obj, rel, and timestamp.
|
|
755
757
|
"""
|
|
756
758
|
import logging
|
|
757
759
|
|
|
@@ -55,7 +55,7 @@ from .excel_toolkit import ExcelToolkit
|
|
|
55
55
|
from .video_analysis_toolkit import VideoAnalysisToolkit
|
|
56
56
|
from .image_analysis_toolkit import ImageAnalysisToolkit
|
|
57
57
|
from .mcp_toolkit import MCPToolkit
|
|
58
|
-
from .
|
|
58
|
+
from .browser_toolkit import BrowserToolkit
|
|
59
59
|
from .file_write_toolkit import FileWriteToolkit
|
|
60
60
|
from .terminal_toolkit import TerminalToolkit
|
|
61
61
|
from .pubmed_toolkit import PubMedToolkit
|
|
@@ -98,11 +98,12 @@ __all__ = [
|
|
|
98
98
|
'SymPyToolkit',
|
|
99
99
|
'MinerUToolkit',
|
|
100
100
|
'MCPToolkit',
|
|
101
|
+
'MCPToolkitManager',
|
|
101
102
|
'AudioAnalysisToolkit',
|
|
102
103
|
'ExcelToolkit',
|
|
103
104
|
'VideoAnalysisToolkit',
|
|
104
105
|
'ImageAnalysisToolkit',
|
|
105
|
-
'
|
|
106
|
+
'BrowserToolkit',
|
|
106
107
|
'FileWriteToolkit',
|
|
107
108
|
'TerminalToolkit',
|
|
108
109
|
'PubMedToolkit',
|