camel-ai 0.2.30__tar.gz → 0.2.31__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.30 → camel_ai-0.2.31}/PKG-INFO +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/__init__.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/_utils.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/apibank.py +8 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/apibench.py +4 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/gaia.py +6 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/nexus.py +4 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/data_collector/sharegpt_collector.py +16 -5
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datahubs/huggingface.py +3 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datasets/base_generator.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/base_io.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/chunkr_reader.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/conversation_models.py +2 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/func_message.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/cohere_model.py +3 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/samba_model.py +4 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/personas/persona.py +1 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/api.py +6 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/docker_runtime.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/remote_http_runtime.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/key_value_storages/json.py +5 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/key_value_storages/redis.py +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/file_write_toolkit.py +2 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/linkedin_toolkit.py +3 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/networkx_toolkit.py +2 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/search_toolkit.py +113 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/semantic_scholar_toolkit.py +2 -2
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/stripe_toolkit.py +17 -8
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/sympy_toolkit.py +54 -27
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/enums.py +3 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/pyproject.toml +1 -1
- {camel_ai-0.2.30 → camel_ai-0.2.31}/.gitignore +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/LICENSE +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/README.md +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/_types.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/chat_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/critic_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/deductive_reasoner_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/embodied_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/knowledge_graph_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/multi_hop_generator_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/programmed_agent_instruction.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/role_assignment_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/search_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/task_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/tool_agents/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/tool_agents/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/agents/tool_agents/hugging_face_tool_agent.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/benchmarks/ragbench.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/discord/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/discord/discord_app.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/discord/discord_installation.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/discord/discord_store.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/slack/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/slack/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/slack/slack_app.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/bots/telegram_bot.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/aiml_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/anthropic_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/base_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/cohere_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/deepseek_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/gemini_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/groq_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/internlm_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/litellm_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/mistral_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/moonshot_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/nvidia_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/ollama_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/openai_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/qwen_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/reka_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/samba_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/sglang_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/siliconflow_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/togetherai_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/vllm_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/yi_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/configs/zhipuai_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/data_collector/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/data_collector/alpaca_collector.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/data_collector/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/cot_datagen.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_improving_cot.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/filter/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/filter/filter_function.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/filter/filter_registry.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/filter/instruction_filter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/self_instruct.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/self_instruct/templates.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/source2synth/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/source2synth/data_processor.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/source2synth/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datagen/source2synth/user_data_processor_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datahubs/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datahubs/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datahubs/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datasets/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datasets/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/datasets/static_dataset.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/jina_embedding.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/mistral_embedding.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/openai_compatible_embedding.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/openai_embedding.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/sentence_transformers_embeddings.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/embeddings/vlm_embedding.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/environments/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/environments/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/environments/multi_step.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/environments/single_step.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/extractors/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/extractors/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/extractors/python_strategies.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/generators.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/human.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/docker/Dockerfile +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/docker_interpreter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/e2b_interpreter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/internal_python_interpreter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/interpreter_error.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/ipython_interpreter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/interpreters/subprocess_interpreter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/apify_reader.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/firecrawl_reader.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/jina_url_reader.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/mineru_extractor.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/panda_reader.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/loaders/unstructured_io.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/logger.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/agent_memories.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/blocks/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/blocks/chat_history_block.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/blocks/vectordb_block.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/context_creators/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/context_creators/score_based.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/memories/records.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/alpaca.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/sharegpt/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/sharegpt/function_call_formatter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/sharegpt/hermes/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/messages/conversion/sharegpt/hermes/hermes_function_formatter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/_utils.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/aiml_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/anthropic_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/azure_openai_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/base_audio_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/base_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/deepseek_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/fish_audio_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/gemini_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/groq_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/internlm_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/litellm_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/mistral_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/model_factory.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/model_manager.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/moonshot_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/nemotron_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/nvidia_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/ollama_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/openai_audio_models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/openai_compatible_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/openai_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/qwen_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reka_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reward/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reward/base_reward_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reward/evaluator.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reward/nemotron_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/reward/skywork_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/sglang_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/siliconflow_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/stub_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/togetherai_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/vllm_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/volcano_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/yi_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/models/zhipuai_model.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/personas/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/personas/persona_hub.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/ai_society.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/code.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/evaluation.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/generate_text_embedding_data.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/image_craft.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/misalignment.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/multi_condition_image_craft.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/object_recognition.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/persona_hub.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/prompt_templates.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/role_description_prompt_template.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/solution_extraction.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/task_prompt_template.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/translation.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/prompts/video_description_prompt.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/py.typed +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/responses/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/responses/agent_responses.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/auto_retriever.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/bm25_retriever.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/cohere_rerank_retriever.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/hybrid_retrival.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/retrievers/vector_retriever.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/configs.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/llm_guard_runtime.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/utils/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/utils/function_risk_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/runtime/utils/ignore_risk_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/schemas/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/schemas/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/schemas/openai_converter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/schemas/outlines_converter.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/babyagi_playing.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/role_playing.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/prompts.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/role_playing_worker.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/single_agent_worker.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/task_channel.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/utils.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/worker.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/societies/workforce/workforce.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/graph_storages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/graph_storages/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/graph_storages/graph_element.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/graph_storages/nebula_graph.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/graph_storages/neo4j_graph.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/key_value_storages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/key_value_storages/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/key_value_storages/in_memory.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/object_storages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/object_storages/amazon_s3.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/object_storages/azure_blob.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/object_storages/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/object_storages/google_cloud.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/vectordb_storages/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/vectordb_storages/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/vectordb_storages/milvus.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/storages/vectordb_storages/qdrant.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/tasks/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/tasks/task.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/tasks/task_prompt.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/terminators/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/terminators/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/terminators/response_terminator.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/terminators/token_limit_terminator.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/arxiv_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/ask_news_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/audio_analysis_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/browser_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/code_execution.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/dalle_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/dappier_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/data_commons_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/excel_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/function_tool.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/github_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/google_maps_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/google_scholar_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/human_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/image_analysis_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/math_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/mcp_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/meshy_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/mineru_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/notion_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/biztoc/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/biztoc/ai-plugin.json +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/biztoc/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/coursera/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/coursera/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/create_qr_code/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/create_qr_code/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/klarna/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/klarna/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/nasa_apod/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/nasa_apod/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/ai-plugin.json +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/paths/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/paths/get_classes.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/outschool/paths/search_teachers.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/security_config.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/speak/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/speak/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/web_scraper/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/web_scraper/ai-plugin.json +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/web_scraper/openapi.yaml +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/web_scraper/paths/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_specs/web_scraper/paths/scraper.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/open_api_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/openbb_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/page_script.js +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/pubmed_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/reddit_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/retrieval_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/slack_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/terminal_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/twitter_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/video_analysis_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/video_download_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/weather_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/whatsapp_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/toolkits/zapier_toolkit.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/agents/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/agents/tool_calling_record.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/openai_types.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/types/unified_model_type.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/async_func.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/commons.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/constants.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/deduplication.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/response_format.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/utils/token_counting.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/verifiers/__init__.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/verifiers/base.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/verifiers/models.py +0 -0
- {camel_ai-0.2.30 → camel_ai-0.2.31}/camel/verifiers/python_verifier.py +0 -0
|
@@ -37,7 +37,7 @@ def generate_tool_prompt(tool_schema_list: List[Dict[str, Any]]) -> str:
|
|
|
37
37
|
tool_info = tool["function"]
|
|
38
38
|
tool_name = tool_info["name"]
|
|
39
39
|
tool_description = tool_info["description"]
|
|
40
|
-
tool_json = json.dumps(tool_info, indent=4)
|
|
40
|
+
tool_json = json.dumps(tool_info, indent=4, ensure_ascii=False)
|
|
41
41
|
|
|
42
42
|
prompt = (
|
|
43
43
|
f"Use the function '{tool_name}' to '{tool_description}':\n"
|
|
@@ -316,7 +316,10 @@ class APIBankBenchmark(BaseBenchmark):
|
|
|
316
316
|
'Correct': correct,
|
|
317
317
|
}
|
|
318
318
|
)
|
|
319
|
-
|
|
319
|
+
json_str = json.dumps(
|
|
320
|
+
self._results[-1], indent=2, ensure_ascii=False
|
|
321
|
+
)
|
|
322
|
+
f.write(json_str + "\n")
|
|
320
323
|
|
|
321
324
|
elif (
|
|
322
325
|
sample.ground_truth['role'] == 'AI'
|
|
@@ -361,7 +364,10 @@ class APIBankBenchmark(BaseBenchmark):
|
|
|
361
364
|
'Test': test,
|
|
362
365
|
}
|
|
363
366
|
)
|
|
364
|
-
|
|
367
|
+
json_str = json.dumps(
|
|
368
|
+
self._results[-1], indent=2, ensure_ascii=False
|
|
369
|
+
)
|
|
370
|
+
f.write(json_str + "\n")
|
|
365
371
|
|
|
366
372
|
f.flush()
|
|
367
373
|
|
|
@@ -323,7 +323,10 @@ class APIBenchBenchmark(BaseBenchmark):
|
|
|
323
323
|
|
|
324
324
|
agent.reset()
|
|
325
325
|
|
|
326
|
-
|
|
326
|
+
json_str = json.dumps(
|
|
327
|
+
self._results[-1], indent=2, ensure_ascii=False
|
|
328
|
+
)
|
|
329
|
+
f.write(json_str + "\n")
|
|
327
330
|
f.flush()
|
|
328
331
|
|
|
329
332
|
total = len(self._results)
|
|
@@ -332,7 +332,9 @@ class GAIABenchmark(BaseBenchmark):
|
|
|
332
332
|
"history": agent.memory.get_context(),
|
|
333
333
|
}
|
|
334
334
|
self._results.append(result_data)
|
|
335
|
-
file_obj.write(
|
|
335
|
+
file_obj.write(
|
|
336
|
+
json.dumps(result_data, indent=2) + "\n", ensure_ascii=False
|
|
337
|
+
)
|
|
336
338
|
file_obj.flush()
|
|
337
339
|
|
|
338
340
|
def _handle_error(
|
|
@@ -351,7 +353,9 @@ class GAIABenchmark(BaseBenchmark):
|
|
|
351
353
|
"score": 0,
|
|
352
354
|
}
|
|
353
355
|
self._results.append(error_data)
|
|
354
|
-
file_obj.write(
|
|
356
|
+
file_obj.write(
|
|
357
|
+
json.dumps(error_data, indent=2) + "\n", ensure_ascii=False
|
|
358
|
+
)
|
|
355
359
|
file_obj.flush()
|
|
356
360
|
|
|
357
361
|
def _generate_summary(self) -> Dict[str, Any]:
|
|
@@ -343,7 +343,10 @@ class NexusBenchmark(BaseBenchmark):
|
|
|
343
343
|
|
|
344
344
|
agent.reset()
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
json_str = json.dumps(
|
|
347
|
+
self._results[-1], indent=2, ensure_ascii=False
|
|
348
|
+
)
|
|
349
|
+
f.write(json_str + "\n")
|
|
347
350
|
f.flush()
|
|
348
351
|
|
|
349
352
|
total = len(self._results)
|
|
@@ -108,6 +108,7 @@ class ShareGPTDataCollector(BaseDataCollector):
|
|
|
108
108
|
tools=json.dumps(
|
|
109
109
|
[t.get_openai_tool_schema()["function"] for t in self.tools]
|
|
110
110
|
),
|
|
111
|
+
ensure_ascii=False,
|
|
111
112
|
conversations=[],
|
|
112
113
|
)
|
|
113
114
|
|
|
@@ -124,7 +125,9 @@ class ShareGPTDataCollector(BaseDataCollector):
|
|
|
124
125
|
conversations.append(
|
|
125
126
|
{
|
|
126
127
|
"from": "function_call",
|
|
127
|
-
"value": json.dumps(
|
|
128
|
+
"value": json.dumps(
|
|
129
|
+
message.function_call, ensure_ascii=False
|
|
130
|
+
),
|
|
128
131
|
}
|
|
129
132
|
)
|
|
130
133
|
else:
|
|
@@ -135,7 +138,9 @@ class ShareGPTDataCollector(BaseDataCollector):
|
|
|
135
138
|
conversations.append(
|
|
136
139
|
{
|
|
137
140
|
"from": "observation",
|
|
138
|
-
"value": json.dumps(
|
|
141
|
+
"value": json.dumps(
|
|
142
|
+
message.message, ensure_ascii=False
|
|
143
|
+
), # type: ignore[attr-defined]
|
|
139
144
|
}
|
|
140
145
|
)
|
|
141
146
|
data["conversations"] = conversations
|
|
@@ -171,7 +176,8 @@ class ShareGPTDataCollector(BaseDataCollector):
|
|
|
171
176
|
context.append(
|
|
172
177
|
"Tools: "
|
|
173
178
|
+ json.dumps(
|
|
174
|
-
[t.get_openai_tool_schema()["function"] for t in self.tools]
|
|
179
|
+
[t.get_openai_tool_schema()["function"] for t in self.tools],
|
|
180
|
+
ensure_ascii=False,
|
|
175
181
|
)
|
|
176
182
|
)
|
|
177
183
|
for _data in self.get_agent_history(str(self.agent_name)):
|
|
@@ -180,10 +186,15 @@ class ShareGPTDataCollector(BaseDataCollector):
|
|
|
180
186
|
f"{role}: " if role != "user" else "User: " + f"{_data.name}: "
|
|
181
187
|
)
|
|
182
188
|
if message.function_call:
|
|
183
|
-
context.append(
|
|
189
|
+
context.append(
|
|
190
|
+
prefix
|
|
191
|
+
+ json.dumps(message.function_call, ensure_ascii=False)
|
|
192
|
+
)
|
|
184
193
|
|
|
185
194
|
elif role == "function" or role == "tool":
|
|
186
|
-
context.append(
|
|
195
|
+
context.append(
|
|
196
|
+
prefix + json.dumps(message.message, ensure_ascii=False)
|
|
197
|
+
) # type: ignore[attr-defined]
|
|
187
198
|
else:
|
|
188
199
|
context.append(prefix + str(message.message))
|
|
189
200
|
return converter.convert(
|
|
@@ -372,6 +372,7 @@ class HuggingFaceDatasetManager(BaseDatasetManager):
|
|
|
372
372
|
for record in records
|
|
373
373
|
],
|
|
374
374
|
f,
|
|
375
|
+
ensure_ascii=False,
|
|
375
376
|
)
|
|
376
377
|
temp_file_path = f.name
|
|
377
378
|
|
|
@@ -411,14 +412,14 @@ class HuggingFaceDatasetManager(BaseDatasetManager):
|
|
|
411
412
|
)
|
|
412
413
|
else:
|
|
413
414
|
try:
|
|
414
|
-
json.dumps(file_content)
|
|
415
|
+
json.dumps(file_content, ensure_ascii=False)
|
|
415
416
|
json_content = file_content
|
|
416
417
|
except (TypeError, ValueError):
|
|
417
418
|
raise ValueError(
|
|
418
419
|
"file_content is not JSON serializable."
|
|
419
420
|
)
|
|
420
421
|
|
|
421
|
-
json.dump(json_content, f)
|
|
422
|
+
json.dump(json_content, f, ensure_ascii=False)
|
|
422
423
|
elif file_type == "md" or file_type == "txt":
|
|
423
424
|
f.write(file_content)
|
|
424
425
|
else:
|
|
@@ -120,7 +120,7 @@ class BaseGenerator(abc.ABC):
|
|
|
120
120
|
try:
|
|
121
121
|
with file_path.open("w", encoding="utf-8") as f:
|
|
122
122
|
for datapoint in self._data:
|
|
123
|
-
json.dump(datapoint.to_dict(), f)
|
|
123
|
+
json.dump(datapoint.to_dict(), f, ensure_ascii=False)
|
|
124
124
|
f.write("\n") # Ensure each entry is on a new line
|
|
125
125
|
logger.info(f"Dataset saved successfully to {file_path}")
|
|
126
126
|
except IOError as e:
|
|
@@ -276,7 +276,7 @@ class JsonFile(File):
|
|
|
276
276
|
# Parse the JSON data from the file
|
|
277
277
|
data = json.load(file)
|
|
278
278
|
# Create a dictionary with the parsed data
|
|
279
|
-
doc = {"page_content": json.dumps(data)}
|
|
279
|
+
doc = {"page_content": json.dumps(data, ensure_ascii=False)}
|
|
280
280
|
# Calculate a unique identifier for the file
|
|
281
281
|
file_id = md5(file.getvalue()).hexdigest()
|
|
282
282
|
# Reset the file pointer to the beginning
|
|
@@ -113,7 +113,7 @@ class ToolCall(BaseModel):
|
|
|
113
113
|
|
|
114
114
|
# Try to serialize arguments to ensure they're JSON-compatible
|
|
115
115
|
try:
|
|
116
|
-
json.dumps(v)
|
|
116
|
+
json.dumps(v, ensure_ascii=False)
|
|
117
117
|
except (TypeError, ValueError):
|
|
118
118
|
raise ValueError("Arguments must be JSON-serializable")
|
|
119
119
|
|
|
@@ -155,7 +155,7 @@ class ToolResponse(BaseModel):
|
|
|
155
155
|
|
|
156
156
|
# Ensure content is JSON-serializable
|
|
157
157
|
try:
|
|
158
|
-
json.dumps(v)
|
|
158
|
+
json.dumps(v, ensure_ascii=False)
|
|
159
159
|
except (TypeError, ValueError):
|
|
160
160
|
raise ValueError("Response content must be JSON-serializable")
|
|
161
161
|
|
|
@@ -176,7 +176,9 @@ class CohereModel(BaseModelBackend):
|
|
|
176
176
|
else:
|
|
177
177
|
arguments = function_call.get("arguments") # type: ignore[attr-defined]
|
|
178
178
|
arguments_dict = ast.literal_eval(arguments)
|
|
179
|
-
arguments_json = json.dumps(
|
|
179
|
+
arguments_json = json.dumps(
|
|
180
|
+
arguments_dict, ensure_ascii=False
|
|
181
|
+
)
|
|
180
182
|
|
|
181
183
|
assis_tool_call_id = str(uuid.uuid4())
|
|
182
184
|
tool_call_id = assis_tool_call_id
|
|
@@ -307,7 +307,8 @@ class SambaModel(BaseModelBackend):
|
|
|
307
307
|
{
|
|
308
308
|
"conversation_id": str(uuid.uuid4()),
|
|
309
309
|
"messages": messages,
|
|
310
|
-
}
|
|
310
|
+
},
|
|
311
|
+
ensure_ascii=False,
|
|
311
312
|
),
|
|
312
313
|
"params": {
|
|
313
314
|
"do_sample": {"type": "bool", "value": "true"},
|
|
@@ -537,7 +538,8 @@ class SambaModel(BaseModelBackend):
|
|
|
537
538
|
{
|
|
538
539
|
"conversation_id": str(uuid.uuid4()),
|
|
539
540
|
"messages": messages,
|
|
540
|
-
}
|
|
541
|
+
},
|
|
542
|
+
ensure_ascii=False,
|
|
541
543
|
),
|
|
542
544
|
"params": {
|
|
543
545
|
"do_sample": {"type": "bool", "value": "true"},
|
|
@@ -80,10 +80,14 @@ for module_function in modules_functions:
|
|
|
80
80
|
output = sys.stdout.read()
|
|
81
81
|
sys.stdout = sys.__stdout__
|
|
82
82
|
return {
|
|
83
|
-
"output": json.dumps(
|
|
83
|
+
"output": json.dumps(
|
|
84
|
+
response_data, ensure_ascii=False
|
|
85
|
+
),
|
|
84
86
|
"stdout": output,
|
|
85
87
|
}
|
|
86
|
-
return {
|
|
88
|
+
return {
|
|
89
|
+
"output": json.dumps(response_data, ensure_ascii=False)
|
|
90
|
+
}
|
|
87
91
|
|
|
88
92
|
except (ImportError, AttributeError) as e:
|
|
89
93
|
logger.error(f"Error importing {module_function}: {e}")
|
|
@@ -100,7 +100,7 @@ class RemoteHttpRuntime(BaseRuntime):
|
|
|
100
100
|
if not isinstance(funcs, list):
|
|
101
101
|
funcs = [funcs]
|
|
102
102
|
if arguments is not None:
|
|
103
|
-
entrypoint += json.dumps(arguments)
|
|
103
|
+
entrypoint += json.dumps(arguments, ensure_ascii=False)
|
|
104
104
|
|
|
105
105
|
for func in funcs:
|
|
106
106
|
inner_func = func.func
|
|
@@ -75,7 +75,11 @@ class JsonStorage(BaseKeyValueStorage):
|
|
|
75
75
|
"""
|
|
76
76
|
with self.json_path.open("a") as f:
|
|
77
77
|
f.writelines(
|
|
78
|
-
[
|
|
78
|
+
[
|
|
79
|
+
json.dumps(r, cls=_CamelJSONEncoder, ensure_ascii=False)
|
|
80
|
+
+ "\n"
|
|
81
|
+
for r in records
|
|
82
|
+
]
|
|
79
83
|
)
|
|
80
84
|
|
|
81
85
|
def load(self) -> List[Dict[str, Any]]:
|
|
@@ -133,7 +133,7 @@ class RedisStorage(BaseKeyValueStorage):
|
|
|
133
133
|
if self._client is None:
|
|
134
134
|
raise ValueError("Redis client is not initialized")
|
|
135
135
|
try:
|
|
136
|
-
value = json.dumps(records)
|
|
136
|
+
value = json.dumps(records, ensure_ascii=False)
|
|
137
137
|
if expire:
|
|
138
138
|
await self._client.setex(self._sid, expire, value)
|
|
139
139
|
else:
|
|
@@ -219,13 +219,13 @@ class FileWriteToolkit(BaseToolkit):
|
|
|
219
219
|
try:
|
|
220
220
|
# Try parsing as JSON string first
|
|
221
221
|
data = json.loads(content)
|
|
222
|
-
json.dump(data, f)
|
|
222
|
+
json.dump(data, f, ensure_ascii=False)
|
|
223
223
|
except json.JSONDecodeError:
|
|
224
224
|
# If not valid JSON string, write as is
|
|
225
225
|
f.write(content)
|
|
226
226
|
else:
|
|
227
227
|
# If not string, dump as JSON
|
|
228
|
-
json.dump(content, f)
|
|
228
|
+
json.dump(content, f, ensure_ascii=False)
|
|
229
229
|
logger.debug(f"Wrote JSON to {file_path} with {encoding} encoding")
|
|
230
230
|
|
|
231
231
|
def _write_yaml_file(
|
|
@@ -75,7 +75,9 @@ class LinkedInToolkit(BaseToolkit):
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
response = requests.post(
|
|
78
|
-
url,
|
|
78
|
+
url,
|
|
79
|
+
headers=headers,
|
|
80
|
+
data=json.dumps(post_data, ensure_ascii=False),
|
|
79
81
|
)
|
|
80
82
|
if response.status_code == 201:
|
|
81
83
|
post_response = response.json()
|
|
@@ -178,7 +178,7 @@ class NetworkXToolkit(BaseToolkit):
|
|
|
178
178
|
"""
|
|
179
179
|
logger.info("Serializing the graph.")
|
|
180
180
|
nx = self._get_nx()
|
|
181
|
-
return json.dumps(nx.node_link_data(self.graph))
|
|
181
|
+
return json.dumps(nx.node_link_data(self.graph), ensure_ascii=False)
|
|
182
182
|
|
|
183
183
|
def deserialize_graph(self, data: str) -> None:
|
|
184
184
|
r"""Loads a graph from a serialized JSON string.
|
|
@@ -199,7 +199,7 @@ class NetworkXToolkit(BaseToolkit):
|
|
|
199
199
|
logger.info(f"Exporting graph to file: {file_path}")
|
|
200
200
|
nx = self._get_nx()
|
|
201
201
|
with open(file_path, "w") as file:
|
|
202
|
-
json.dump(nx.node_link_data(self.graph), file)
|
|
202
|
+
json.dump(nx.node_link_data(self.graph), file, ensure_ascii=False)
|
|
203
203
|
|
|
204
204
|
def import_from_file(self, file_path: str) -> None:
|
|
205
205
|
r"""Imports a graph from a JSON file.
|
|
@@ -751,7 +751,8 @@ class SearchToolkit(BaseToolkit):
|
|
|
751
751
|
"summary": summary,
|
|
752
752
|
"count": count,
|
|
753
753
|
"page": page,
|
|
754
|
-
}
|
|
754
|
+
},
|
|
755
|
+
ensure_ascii=False,
|
|
755
756
|
)
|
|
756
757
|
try:
|
|
757
758
|
response = requests.post(url, headers=headers, data=payload)
|
|
@@ -835,6 +836,116 @@ class SearchToolkit(BaseToolkit):
|
|
|
835
836
|
except Exception as e:
|
|
836
837
|
return {"error": f"Baidu scraping error: {e!s}"}
|
|
837
838
|
|
|
839
|
+
def search_bing(self, query: str, max_results: int = 5) -> Dict[str, Any]:
|
|
840
|
+
r"""Use Bing search engine to search information for the given query.
|
|
841
|
+
|
|
842
|
+
This function queries the Chinese version of Bing search engine (cn.
|
|
843
|
+
bing.com) using web scraping to retrieve relevant search results. It
|
|
844
|
+
extracts search results including titles, snippets, and URLs. This
|
|
845
|
+
function is particularly useful when the query is in Chinese or when
|
|
846
|
+
Chinese search results are desired.
|
|
847
|
+
|
|
848
|
+
Args:
|
|
849
|
+
query (str): The search query string to submit to Bing. Works best
|
|
850
|
+
with Chinese queries or when Chinese results are preferred.
|
|
851
|
+
max_results (int): Maximum number of results to return.
|
|
852
|
+
(default: :obj:`5`)
|
|
853
|
+
|
|
854
|
+
Returns:
|
|
855
|
+
Dict ([str, Any]): A dictionary containing either:
|
|
856
|
+
- 'results': A list of dictionaries, each with:
|
|
857
|
+
- 'result_id': The index of the result.
|
|
858
|
+
- 'snippet': A brief description of the search result.
|
|
859
|
+
- 'title': The title of the search result.
|
|
860
|
+
- 'link': The URL of the search result.
|
|
861
|
+
- or 'error': An error message if something went wrong.
|
|
862
|
+
"""
|
|
863
|
+
from typing import Any, Dict, List, cast
|
|
864
|
+
from urllib.parse import urlencode
|
|
865
|
+
|
|
866
|
+
from bs4 import BeautifulSoup, Tag
|
|
867
|
+
|
|
868
|
+
try:
|
|
869
|
+
query = urlencode({"q": query})
|
|
870
|
+
url = f'https://cn.bing.com/search?{query}'
|
|
871
|
+
headers = {
|
|
872
|
+
"User-Agent": (
|
|
873
|
+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
|
|
874
|
+
"AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
875
|
+
"Chrome/120.0.0.0 Safari/537.36"
|
|
876
|
+
),
|
|
877
|
+
}
|
|
878
|
+
# Add timeout to prevent hanging
|
|
879
|
+
response = requests.get(url, headers=headers, timeout=10)
|
|
880
|
+
|
|
881
|
+
# Check if the request was successful
|
|
882
|
+
if response.status_code != 200:
|
|
883
|
+
return {
|
|
884
|
+
"error": (
|
|
885
|
+
f"Bing returned status code: "
|
|
886
|
+
f"{response.status_code}"
|
|
887
|
+
)
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
response.encoding = 'utf-8'
|
|
891
|
+
soup = BeautifulSoup(response.text, 'html.parser')
|
|
892
|
+
|
|
893
|
+
b_results_element = soup.find("ol", id="b_results")
|
|
894
|
+
if b_results_element is None:
|
|
895
|
+
return {"results": []}
|
|
896
|
+
|
|
897
|
+
# Ensure b_results is a Tag and find all li elements
|
|
898
|
+
b_results_tag = cast(Tag, b_results_element)
|
|
899
|
+
result_items = b_results_tag.find_all("li")
|
|
900
|
+
|
|
901
|
+
results: List[Dict[str, Any]] = []
|
|
902
|
+
for i in range(min(len(result_items), max_results)):
|
|
903
|
+
row = result_items[i]
|
|
904
|
+
if not isinstance(row, Tag):
|
|
905
|
+
continue
|
|
906
|
+
|
|
907
|
+
h2_element = row.find("h2")
|
|
908
|
+
if h2_element is None:
|
|
909
|
+
continue
|
|
910
|
+
h2_tag = cast(Tag, h2_element)
|
|
911
|
+
|
|
912
|
+
title = h2_tag.get_text().strip()
|
|
913
|
+
|
|
914
|
+
link_tag_element = h2_tag.find("a")
|
|
915
|
+
if link_tag_element is None:
|
|
916
|
+
continue
|
|
917
|
+
link_tag = cast(Tag, link_tag_element)
|
|
918
|
+
|
|
919
|
+
link = link_tag.get("href")
|
|
920
|
+
if link is None:
|
|
921
|
+
continue
|
|
922
|
+
|
|
923
|
+
content_element = row.find("p", class_="b_algoSlug")
|
|
924
|
+
content_text = ""
|
|
925
|
+
if content_element is not None and isinstance(
|
|
926
|
+
content_element, Tag
|
|
927
|
+
):
|
|
928
|
+
content_text = content_element.get_text()
|
|
929
|
+
|
|
930
|
+
row_data = {
|
|
931
|
+
"result_id": i + 1,
|
|
932
|
+
"snippet": content_text,
|
|
933
|
+
"title": title,
|
|
934
|
+
"link": link,
|
|
935
|
+
}
|
|
936
|
+
results.append(row_data)
|
|
937
|
+
|
|
938
|
+
if not results:
|
|
939
|
+
return {
|
|
940
|
+
"warning": "No results found. Check if "
|
|
941
|
+
"Bing HTML structure has changed."
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
return {"results": results}
|
|
945
|
+
|
|
946
|
+
except Exception as e:
|
|
947
|
+
return {"error": f"Bing scraping error: {e!s}"}
|
|
948
|
+
|
|
838
949
|
def get_tools(self) -> List[FunctionTool]:
|
|
839
950
|
r"""Returns a list of FunctionTool objects representing the
|
|
840
951
|
functions in the toolkit.
|
|
@@ -853,4 +964,5 @@ class SearchToolkit(BaseToolkit):
|
|
|
853
964
|
FunctionTool(self.search_brave),
|
|
854
965
|
FunctionTool(self.search_bocha),
|
|
855
966
|
FunctionTool(self.search_baidu),
|
|
967
|
+
FunctionTool(self.search_bing),
|
|
856
968
|
]
|
|
@@ -238,7 +238,7 @@ class SemanticScholarToolkit(BaseToolkit):
|
|
|
238
238
|
papers = response.json()
|
|
239
239
|
if save_to_file:
|
|
240
240
|
with open('recommended_papers.json', 'w') as output:
|
|
241
|
-
json.dump(papers, output)
|
|
241
|
+
json.dump(papers, output, ensure_ascii=False)
|
|
242
242
|
return papers
|
|
243
243
|
except requests.exceptions.RequestException as e:
|
|
244
244
|
return {"error": str(e)}
|
|
@@ -282,7 +282,7 @@ class SemanticScholarToolkit(BaseToolkit):
|
|
|
282
282
|
response_data = response.json()
|
|
283
283
|
if save_to_file:
|
|
284
284
|
with open('author_information.json', 'w') as output:
|
|
285
|
-
json.dump(response_data, output)
|
|
285
|
+
json.dump(response_data, output, ensure_ascii=False)
|
|
286
286
|
return response_data
|
|
287
287
|
except requests.exceptions.RequestException as e:
|
|
288
288
|
return {"error": str(e)}
|
|
@@ -85,7 +85,7 @@ class StripeToolkit(BaseToolkit):
|
|
|
85
85
|
self.logger.info(f"Retrieving customer with ID: {customer_id}")
|
|
86
86
|
customer = stripe.Customer.retrieve(customer_id)
|
|
87
87
|
self.logger.info(f"Retrieved customer: {customer.id}")
|
|
88
|
-
json_string = json.dumps(customer)
|
|
88
|
+
json_string = json.dumps(customer, ensure_ascii=False)
|
|
89
89
|
return json_string
|
|
90
90
|
except Exception as e:
|
|
91
91
|
return self.handle_exception("customer_get", e)
|
|
@@ -109,7 +109,9 @@ class StripeToolkit(BaseToolkit):
|
|
|
109
109
|
self.logger.info(
|
|
110
110
|
f"Successfully retrieved {len(customers)} customers."
|
|
111
111
|
)
|
|
112
|
-
return json.dumps(
|
|
112
|
+
return json.dumps(
|
|
113
|
+
[customer for customer in customers], ensure_ascii=False
|
|
114
|
+
)
|
|
113
115
|
except Exception as e:
|
|
114
116
|
return self.handle_exception("customer_list", e)
|
|
115
117
|
|
|
@@ -128,7 +130,7 @@ class StripeToolkit(BaseToolkit):
|
|
|
128
130
|
self.logger.info(
|
|
129
131
|
f"Successfully retrieved account balance: {balance}."
|
|
130
132
|
)
|
|
131
|
-
return json.dumps(balance)
|
|
133
|
+
return json.dumps(balance, ensure_ascii=False)
|
|
132
134
|
except Exception as e:
|
|
133
135
|
return self.handle_exception("balance_get", e)
|
|
134
136
|
|
|
@@ -154,7 +156,10 @@ class StripeToolkit(BaseToolkit):
|
|
|
154
156
|
f"Successfully retrieved {len(transactions)} "
|
|
155
157
|
"balance transactions."
|
|
156
158
|
)
|
|
157
|
-
return json.dumps(
|
|
159
|
+
return json.dumps(
|
|
160
|
+
[transaction for transaction in transactions],
|
|
161
|
+
ensure_ascii=False,
|
|
162
|
+
)
|
|
158
163
|
except Exception as e:
|
|
159
164
|
return self.handle_exception("balance_transaction_list", e)
|
|
160
165
|
|
|
@@ -174,7 +179,7 @@ class StripeToolkit(BaseToolkit):
|
|
|
174
179
|
self.logger.info(f"Retrieving payment with ID: {payment_id}")
|
|
175
180
|
payment = stripe.PaymentIntent.retrieve(payment_id)
|
|
176
181
|
self.logger.info(f"Retrieved payment: {payment.id}")
|
|
177
|
-
return json.dumps(payment)
|
|
182
|
+
return json.dumps(payment, ensure_ascii=False)
|
|
178
183
|
except Exception as e:
|
|
179
184
|
return self.handle_exception("payment_get", e)
|
|
180
185
|
|
|
@@ -197,7 +202,9 @@ class StripeToolkit(BaseToolkit):
|
|
|
197
202
|
self.logger.info(
|
|
198
203
|
f"Successfully retrieved {len(payments)} payments."
|
|
199
204
|
)
|
|
200
|
-
return json.dumps(
|
|
205
|
+
return json.dumps(
|
|
206
|
+
[payment for payment in payments], ensure_ascii=False
|
|
207
|
+
)
|
|
201
208
|
except Exception as e:
|
|
202
209
|
return self.handle_exception("payment_list", e)
|
|
203
210
|
|
|
@@ -217,7 +224,7 @@ class StripeToolkit(BaseToolkit):
|
|
|
217
224
|
self.logger.info(f"Retrieving refund with ID: {refund_id}")
|
|
218
225
|
refund = stripe.Refund.retrieve(refund_id)
|
|
219
226
|
self.logger.info(f"Retrieved refund: {refund.id}")
|
|
220
|
-
return json.dumps(refund)
|
|
227
|
+
return json.dumps(refund, ensure_ascii=False)
|
|
221
228
|
except Exception as e:
|
|
222
229
|
return self.handle_exception("refund_get", e)
|
|
223
230
|
|
|
@@ -238,7 +245,9 @@ class StripeToolkit(BaseToolkit):
|
|
|
238
245
|
self.logger.info(f"Listing refunds with limit={limit}")
|
|
239
246
|
refunds = stripe.Refund.list(limit=limit).data
|
|
240
247
|
self.logger.info(f"Successfully retrieved {len(refunds)} refunds.")
|
|
241
|
-
return json.dumps(
|
|
248
|
+
return json.dumps(
|
|
249
|
+
[refund for refund in refunds], ensure_ascii=False
|
|
250
|
+
)
|
|
242
251
|
except Exception as e:
|
|
243
252
|
return self.handle_exception("refund_list", e)
|
|
244
253
|
|