🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: CI Bug (#2498)
Wendong-Fanc51478248ad0
diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.ymlindex 7da81c903..ce42445e9 100644--- a/.github/workflows/documentation.yml+++ b/.github/workflows/documentation.yml@@ -3,6 +3,8 @@ name: Build and deploy camel documentson:push:branches: [ "master", "qa" ]+ pull_request:+ types: [opened, synchronize, reopened]workflow_dispatch:permissions:@@ -16,7 +18,8 @@ jobs:- name: Checkout codeuses: actions/checkout@v4with:- fetch-depth: 0 # Fetch full history for git diff+ fetch-depth: 0 # Full history for git diff+ token: ${{ secrets.GITHUB_TOKEN }}- name: Set up Python environment and install dependenciesuses: ./.github/actions/camel_install@@ -31,8 +34,8 @@ jobs:source .venv/bin/activatecd docsmake html-- - name: Deploy++ - name: Deploy Sphinx to GitHub Pagesuses: peaceiris/actions-gh-pages@v4if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}with:@@ -42,16 +45,26 @@ jobs:force_orphan: truecname: docs.camel-ai.org- - name: Convert Notebooks and Update Mintlify Config+ - name: Convert Cookbooks and Update Mintlify Configrun: |source .venv/bin/activate-- # Check if this is a push event or workflow_dispatch- if [ "${{ github.event_name }}" = "push" ]; then- echo "Push event detected - using incremental mode with git"++ if [ "${{ github.event_name }}" = "pull_request" ]; then+ echo "PR event detected - using incremental mode for cookbooks"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/cookbooks \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --incremental \+ --use-git \+ --base-branch origin/${{ github.base_ref }} \+ --verbose+ elif [ "${{ github.event_name }}" = "push" ]; then+ echo "Push event detected - using incremental mode for cookbooks"python docs/mintlify/convert_notebook2mdx.py \--input docs/cookbooks \- --output docs/mintlify/cookbooks \+ --output docs/mintlify \--update-docs-json docs/mintlify/docs.json \--docs-path-prefix "" \--incremental \@@ -59,50 +72,136 @@ jobs:--base-branch origin/master \--verboseelse- echo "Manual workflow dispatch - processing all files"+ echo "Manual workflow - processing all cookbooks files"python docs/mintlify/convert_notebook2mdx.py \--input docs/cookbooks \- --output docs/mintlify/cookbooks \+ --output docs/mintlify \--update-docs-json docs/mintlify/docs.json \--docs-path-prefix "" \--verbosefi- - name: Generate API Documentation+ - name: Convert Get Started docsrun: |source .venv/bin/activate-- # Check if this is a push event for incremental API docs- if [ "${{ github.event_name }}" = "push" ]; then- echo "Push event detected - using incremental mode for API docs"- python docs/mintlify/build_api_docs.py \- --output_dir docs/mintlify/reference \- --mint_json docs/mintlify/docs.json \- --package camel \++ if [ "${{ github.event_name }}" = "pull_request" ]; then+ echo "PR event detected - using incremental mode for get_started"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/get_started \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \--incremental \- --since_hours 24+ --use-git \+ --base-branch origin/${{ github.base_ref }} \+ --verbose+ elif [ "${{ github.event_name }}" = "push" ]; then+ echo "Push event detected - using incremental mode for get_started"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/get_started \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --incremental \+ --use-git \+ --base-branch origin/master \+ --verboseelse- echo "Manual workflow dispatch - generating all API docs"- python docs/mintlify/build_api_docs.py \- --output_dir docs/mintlify/reference \- --mint_json docs/mintlify/docs.json \- --package camel \- --clean+ echo "Manual workflow - processing all get_started files"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/get_started \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --verbosefi- - name: Commit and push changes+ - name: Convert Key Modules docs+ run: |+ source .venv/bin/activate++ if [ "${{ github.event_name }}" = "pull_request" ]; then+ echo "PR event detected - using incremental mode for key_modules"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/key_modules \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --incremental \+ --use-git \+ --base-branch origin/${{ github.base_ref }} \+ --verbose+ elif [ "${{ github.event_name }}" = "push" ]; then+ echo "Push event detected - using incremental mode for key_modules"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/key_modules \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --incremental \+ --use-git \+ --base-branch origin/master \+ --verbose+ else+ echo "Manual workflow - processing all key_modules files"+ python docs/mintlify/convert_notebook2mdx.py \+ --input docs/key_modules \+ --output docs/mintlify \+ --update-docs-json docs/mintlify/docs.json \+ --docs-path-prefix "" \+ --verbose+ fi++ - name: Generate API Documentation+ run: |+ source .venv/bin/activate+ echo "Using incremental API docs generation for optimal performance"+ python docs/mintlify/build_api_docs.py \+ --output_dir docs/mintlify/reference \+ --mint_json docs/mintlify/docs.json \+ --package camel \+ --incremental \+ --since_hours 24++ - name: Commit and push changes to PR branch+ if: ${{ github.event_name == 'pull_request' }}+ run: |+ git config --local user.email "[email protected]"+ git config --local user.name "GitHub Action"++ git add docs/mintlify/ docs/mintlify/get_started/ docs/mintlify/key_modules/ docs/mintlify/reference/ docs/mintlify/docs.json++ if git diff --staged --quiet; then+ echo "No changes to commit"+ else+ git commit -m "Auto-update Mintlify documentation"++ # Try multiple push strategies+ if ! git push origin ${{ github.head_ref }}; then+ echo "First push attempt failed, trying alternative methods..."++ # Try with current branch+ CURRENT_BRANCH=$(git branch --show-current)+ echo "Trying to push current branch: $CURRENT_BRANCH"+ if ! git push origin "$CURRENT_BRANCH"; then+ echo "Second push attempt failed, trying with HEAD:refs/heads/${{ github.head_ref }}"+ git push origin "HEAD:refs/heads/${{ github.head_ref }}"+ fi+ fi+ fi++ - name: Commit and push changes (only for push to master/qa)if: ${{ github.event_name == 'push' }}run: |git config --local user.email "[email protected]"git config --local user.name "GitHub Action"-- # Add any new or modified files- git add docs/mintlify/cookbooks/ docs/mintlify/reference/ docs/mintlify/docs.json-- # Check if there are any changes to commit++ git add docs/mintlify/ docs/mintlify/get_started/ docs/mintlify/key_modules/ docs/mintlify/reference/ docs/mintlify/docs.json+if git diff --staged --quiet; thenecho "No changes to commit"else- git commit -m "Auto-update documentation [skip ci]"- git push- fi\ No newline at end of file+ echo "Changes detected but skipping commit for push events to avoid protected branch issues"+ echo "Documentation will be updated when PR is merged"+ fidiff --git a/docs/get_started/installation.md b/docs/get_started/installation.mdindex fe5d54796..e6c918a99 100644--- a/docs/get_started/installation.md+++ b/docs/get_started/installation.md@@ -19,7 +19,7 @@ Available extras:- `all`: Includes all features below- `model_platforms`: OpenAI, Google, Mistral, Anthropic Claude, Cohere etc.- `huggingface`: Transformers, Diffusers, Accelerate, Datasets, PyTorch etc.-- `rag`: Sentence Transformers, Qdrant, Milvus, TiDB, OceanBase,BM25 etc.+- `rag`: Sentence Transformers, Qdrant, Milvus, TiDB, BM25,OceanBase etc.- `storage`: Neo4j, Redis, Azure Blob, Google Cloud Storage, AWS S3 etc.- `web_tools`: DuckDuckGo, Wikipedia, WolframAlpha, Google Maps, Weather API etc.- `document_tools`: PDF, Word, OpenAPI, BeautifulSoup, Unstructured etc.diff --git a/docs/key_modules/storages.md b/docs/key_modules/storages.mdindex 7e6c9dd01..b966042b3 100644--- a/docs/key_modules/storages.md+++ b/docs/key_modules/storages.md@@ -255,7 +255,7 @@ from camel.storages.vectordb_storages import (Before running this example, you need to setup an OceanBase instance:(Option 1): OceanBase Community Edition (OCE):1. Download and install OCE from the official website:- https://www.oceanbase.com/docs/oceanbase-database-cn+ https://www.oceanbase.com/docs/oceanbase-database2. Start the OceanBase server and create a database user3. Install PyOBVector package:pip install pyobvector@@ -349,7 +349,7 @@ Adding vectors in batches...Vector count after adding batch: 1000Querying similar vectors...Result 1:- ID: f33f008d-688a-468a-9a2d-e005d27ad9d8+ ID: f33f008d-688a-468a-9a2d-e005d27ad9d9Payload: {'idx': 496, 'batch': 'example'}Similarity: 0.9847431876706196Result 2:@@ -361,7 +361,7 @@ Result 3:Payload: {'idx': 654, 'batch': 'example'}Similarity: 0.9548076959468635Result 4:- ID: 8d6359ff-49fd-4fb7-99fd-bf4ca0a0cdcc+ ID: 8d6359ff-49fd-4fb7-99fd-bf4ca0a0cdcxPayload: {'idx': 914, 'batch': 'example'}Similarity: 0.9496165658207311Result 5:diff --git a/docs/mintlify/convert_notebook2mdx.py b/docs/mintlify/convert_notebook2mdx.pyindex 3fa737d3b..0cc40ca51 100644--- a/docs/mintlify/convert_notebook2mdx.py+++ b/docs/mintlify/convert_notebook2mdx.py@@ -932,12 +932,26 @@ def get_git_changed_files(file_extensions = ['.ipynb', '.md']try:- # Get list of changed files from git+ # Find the git repository root+ git_root_result = subprocess.run(+ ['git', 'rev-parse', '--show-toplevel'],+ capture_output=True,+ text=True,+ cwd=directory,+ )++ if git_root_result.returncode != 0:+ print(f"Failed to find git root: {git_root_result.stderr}")+ return []++ git_root = Path(git_root_result.stdout.strip())++ # Get list of changed files from git (run from git root)result = subprocess.run(['git', 'diff', '--name-only', base_branch, 'HEAD'],capture_output=True,text=True,- cwd=directory,+ cwd=git_root,)if result.returncode != 0:@@ -945,16 +959,26 @@ def get_git_changed_files(return []changed_files = []- directory = Path(directory)+ directory = Path(directory).resolve() # Convert to absolute pathfor file_path in result.stdout.strip().split('\n'):if file_path: # Skip empty lines- full_path = directory / file_path- # Check if file exists and has the right extension- if full_path.exists() and any(- file_path.endswith(ext) for ext in file_extensions- ):- changed_files.append(full_path)+ # file_path is relative to git root+ full_path = git_root / file_path++ # Check if file is under the target directory and has the right extension+ try:+ # Check if the file is under our target directory+ full_path.resolve().relative_to(directory)++ # Check if file exists and has the right extension+ if full_path.exists() and any(+ file_path.endswith(ext) for ext in file_extensions+ ):+ changed_files.append(full_path)+ except ValueError:+ # File is not under target directory, skip it+ continuereturn sorted(changed_files)diff --git a/docs/mintlify/docs.json b/docs/mintlify/docs.jsonindex 48d73ec70..45a8cefc5 100644--- a/docs/mintlify/docs.json+++ b/docs/mintlify/docs.json@@ -72,8 +72,8 @@{"group": "Basic Concepts","pages": [- "cookbooks/basic_concepts/agents_prompting","cookbooks/basic_concepts/agents_message",+ "cookbooks/basic_concepts/agents_prompting","cookbooks/basic_concepts/create_your_first_agent","cookbooks/basic_concepts/create_your_first_agents_society","cookbooks/basic_concepts/model_speed_comparison"@@ -83,27 +83,29 @@"group": "Advanced Features","pages": ["cookbooks/advanced_features/agents_tracking",- "cookbooks/advanced_features/agents_with_graph_rag",+ "cookbooks/advanced_features/agents_with_MCP","cookbooks/advanced_features/agents_with_dkg",+ "cookbooks/advanced_features/agents_with_graph_rag","cookbooks/advanced_features/agents_with_human_in_loop_and_tool_approval","cookbooks/advanced_features/agents_with_memory","cookbooks/advanced_features/agents_with_rag","cookbooks/advanced_features/agents_with_tools",+ "cookbooks/advanced_features/agents_with_tools_from_ACI","cookbooks/advanced_features/agents_with_tools_from_Composio","cookbooks/advanced_features/critic_agents_and_tree_search",- "cookbooks/advanced_features/embodied_agents",- "cookbooks/advanced_features/agents_with_MCP"+ "cookbooks/advanced_features/embodied_agents"]},{"group": "Applications","pages": [- "cookbooks/applications/customer_service_Discord_bot_using_local_model_with_agentic_RAG",+ "cookbooks/applications/customer_service_Discord_bot_using_Cohere_model_with_agentic_RAG","cookbooks/applications/customer_service_Discord_bot_using_SambaNova_with_agentic_RAG",+ "cookbooks/applications/customer_service_Discord_bot_using_local_model_with_agentic_RAG","cookbooks/applications/customer_service_Discord_bot_with_agentic_RAG","cookbooks/applications/dynamic_travel_planner",- "cookbooks/applications/roleplaying_scraper",- "cookbooks/applications/finance_discord_bot"+ "cookbooks/applications/finance_discord_bot",+ "cookbooks/applications/roleplaying_scraper"]},{@@ -111,13 +113,14 @@"pages": ["cookbooks/data_generation/cot_data_gen_sft_qwen_unsolth_upload_huggingface","cookbooks/data_generation/data_gen_with_real_function_calls_and_hermes_format",- "cookbooks/data_generation/distill_math_reasoning_data_from_deepseek_r1","cookbooks/data_generation/data_model_generation_and_structured_output_with_qwen",+ "cookbooks/data_generation/distill_math_reasoning_data_from_deepseek_r1","cookbooks/data_generation/self_improving_cot_generation","cookbooks/data_generation/self_improving_math_reasoning_data_distillation_from_deepSeek_r1",+ "cookbooks/data_generation/self_instruct_data_generation",+ "cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_Qwen2_5_7B","cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_mistral_7b_instruct","cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_tinyllama",- "cookbooks/data_generation/sft_data_generation_and_unsloth_finetuning_Qwen2_5_7B","cookbooks/data_generation/synthetic_dataevaluation&filter_with_reward_model"]},@@ -133,8 +136,8 @@"group": "Loong","pages": ["cookbooks/loong/batched_single_step_env",- "cookbooks/loong/single_step_env",- "cookbooks/loong/multi_step_rl"+ "cookbooks/loong/multi_step_rl",+ "cookbooks/loong/single_step_env"]},{@@ -441,6 +444,7 @@"reference/camel.toolkits.base","reference/camel.toolkits.bohrium_toolkit","reference/camel.toolkits.browser_toolkit",+ "reference/camel.toolkits.browser_toolkit_commons","reference/camel.toolkits.code_execution","reference/camel.toolkits.dalle_toolkit","reference/camel.toolkits.dappier_toolkit",@@ -571,6 +575,57 @@"reference/camel.personas.persona","reference/camel.personas.persona_hub"]+ },+ {+ "group": "Benchmarks",+ "pages": [+ "reference/camel.benchmarks.apibank",+ "reference/camel.benchmarks.apibench",+ "reference/camel.benchmarks.base",+ "reference/camel.benchmarks.browsecomp",+ "reference/camel.benchmarks.gaia",+ "reference/camel.benchmarks.nexus",+ "reference/camel.benchmarks.ragbench"+ ]+ },+ {+ "group": "Data Collector",+ "pages": [+ "reference/camel.data_collector.alpaca_collector",+ "reference/camel.data_collector.base",+ "reference/camel.data_collector.sharegpt_collector"+ ]+ },+ {+ "group": "Datahubs",+ "pages": [+ "reference/camel.datahubs.base",+ "reference/camel.datahubs.huggingface"+ ]+ },+ {+ "group": "Loaders",+ "pages": [+ "reference/camel.loaders.apify_reader",+ "reference/camel.loaders.base_io",+ "reference/camel.loaders.chunkr_reader",+ "reference/camel.loaders.crawl4ai_reader",+ "reference/camel.loaders.firecrawl_reader",+ "reference/camel.loaders.jina_url_reader",+ "reference/camel.loaders.markitdown",+ "reference/camel.loaders.mineru_extractor",+ "reference/camel.loaders.pandas_reader",+ "reference/camel.loaders.scrapegraph_reader",+ "reference/camel.loaders.unstructured_io"+ ]+ },+ {+ "group": "Schemas",+ "pages": [+ "reference/camel.schemas.base",+ "reference/camel.schemas.openai_converter",+ "reference/camel.schemas.outlines_converter"+ ]}]}diff --git a/docs/mintlify/get_started/installation.mdx b/docs/mintlify/get_started/installation.mdxindex 63eecad49..5b53b9f09 100644--- a/docs/mintlify/get_started/installation.mdx+++ b/docs/mintlify/get_started/installation.mdx@@ -23,7 +23,7 @@ Available extras:- `all`: Includes all features below- `model_platforms`: OpenAI, Google, Mistral, Anthropic Claude, Cohere etc.- `huggingface`: Transformers, Diffusers, Accelerate, Datasets, PyTorch etc.-- `rag`: Sentence Transformers, Qdrant, Milvus, TiDB, BM25 etc.+- `rag`: Sentence Transformers, Qdrant, Milvus, TiDB, BM25,OceanBase etc.- `storage`: Neo4j, Redis, Azure Blob, Google Cloud Storage, AWS S3 etc.- `web_tools`: DuckDuckGo, Wikipedia, WolframAlpha, Google Maps, Weather API etc.- `document_tools`: PDF, Word, OpenAPI, BeautifulSoup, Unstructured etc.diff --git a/docs/mintlify/key_modules/society.mdx b/docs/mintlify/key_modules/society.mdxindex d3f11c0df..55c2f3d1b 100644--- a/docs/mintlify/key_modules/society.mdx+++ b/docs/mintlify/key_modules/society.mdx@@ -24,7 +24,7 @@ Taking `RolePlaying` as an example, this framework was designed in an instructioWhen using `RolePlaying` framework in CAMEL, predefined prompts are used to create unique initial settings for different agents. For example, if the user wants to initialize an assistant agent, the agent will be initialized with the following prompt.-- Never forget you are a [ASSISTANT_ROLE] and I am a [USER_ROLE].+- Never forget you are a `<ASSISTANT_ROLE>` and I am a `<USER_ROLE>`.*This assigns the chosen role to the assistant agent and provides it with information about the user’s role.*- Never flip roles! Never instruct me!@@ -33,7 +33,7 @@ When using `RolePlaying` framework in CAMEL, predefined prompts are used to crea- You must decline my instruction honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.*This prohibits the agent from producing harmful, false, illegal, and misleading information.*-- Unless I say the task is completed, you should always start with: Solution: [YOUR_SOLUTION]. [YOUR_SOLUTION] should be specific, and provide preferable implementations and examples for task-solving.+- Unless I say the task is completed, you should always start with: Solution: `<YOUR_SOLUTION>`. `<YOUR_SOLUTION>` should be specific, and provide preferable implementations and examples for task-solving.*This encourages the assistant to always responds in a consistent format, avoiding any deviation from the structure of the conversation, and preventing vague or incomplete responses, which we refer to as flake responses, such as "I will do something".*- Always end your solution with: Next request.@@ -66,7 +66,7 @@ When using `RolePlaying` framework in CAMEL, predefined prompts are used to crea| output_language | str | The language to be output by the agents. |## 2.2 `BabyAGI`-Babyagi is framework from "Task-driven Autonomous Agent" `<https://github.com/yoheinakajima/babyagi>`+Babyagi is framework from "Task-driven Autonomous Agent" `https://github.com/yoheinakajima/babyagi`## 3. Get Starteddiff --git a/docs/mintlify/key_modules/storages.mdx b/docs/mintlify/key_modules/storages.mdxindex b950178bf..36a8f1cab 100644--- a/docs/mintlify/key_modules/storages.mdx+++ b/docs/mintlify/key_modules/storages.mdx@@ -60,6 +60,13 @@ Reference: [TiDB](https://ai.pingcap.com/)Reference: [Qdrant](https://qdrant.tech/)++**`OceanBaseStorage`**:++- Description: A concrete implementation of `BaseVectorStorage`, tailored for interacting with OceanBase vector engine.++Reference: [OceanBase](https://www.oceanbase.com/)+### 2.3 Graph Storages**`BaseGraphStorage`**:@@ -236,9 +243,143 @@ qdrant_storage.clear()``````markdown>>> {'key2': 'value2'} 0.5669467095138407+```+### 3.6. Using `OceanBaseStorage`++```python+import random++from camel.storages.vectordb_storages import (+ OceanBaseStorage,+ VectorDBQuery,+ VectorRecord,+)++"""+Before running this example, you need to setup an OceanBase instance:+(Option 1): OceanBase Community Edition:+1. Download and install OCE from the official website:+ https://www.oceanbase.com/docs/oceanbase-database+2. Start the OceanBase server and create a database user+3. Install PyOBVector package:+ pip install pyobvector+(Option 2): OceanBase Cloud Service:+1. Sign up for OceanBase Cloud Service+2. Create a cluster with OceanBase Vector enabled+3. Get your connection parameters from the service console+The connection parameters should include:+- URI: hostname:port+- User: username@tenant+- Password: your_password+- Database name: database_name+"""++# Replace these with your OceanBase connection parameters+OB_URI = "127.0.0.1:2881"+OB_USER = "root@sys"+OB_PASSWORD = ""+OB_DB_NAME = "oceanbase"+++def main():+ # Create an instance of OceanBaseStorage with dimension = 64+ ob_storage = OceanBaseStorage(+ vector_dim=4,+ table_name="my_ob_vector_table",+ uri=OB_URI,+ user=OB_USER,+ password=OB_PASSWORD,+ db_name=OB_DB_NAME,+ distance="cosine",+ )++ # Get database status+ status = ob_storage.status()+ print(f"Vector dimension: {status.vector_dim}")+ print(f"Initial vector count: {status.vector_count}")++ # Generate and add a larger number of vectors using batching+ print("\nAdding vectors in batches...")+ random.seed(20241023)++ # Create a large batch of vector records+ large_batch = []+ for i in range(1000):+ large_batch.append(+ VectorRecord(+ vector=[random.uniform(-1, 1) for _ in range(4)],+ payload={'idx': i, 'batch': 'example'},+ )+ )++ # Add vectors with automatic batching (batch_size=100)+ ob_storage.add(large_batch, batch_size=100)++ # Check updated status+ status = ob_storage.status()+ print(f"Vector count after adding batch: {status.vector_count}")++ # Generate a query vector and search for similar vectors+ print("\nQuerying similar vectors...")+ query_vector = [random.uniform(-1, 1) for _ in range(4)]+ query_results = ob_storage.query(+ VectorDBQuery(query_vector=query_vector, top_k=5)+ )++ # Display results+ for i, result in enumerate(query_results):+ print(f"Result {i+1}:")+ print(f" ID: {result.record.id}")+ print(f" Payload: {result.record.payload}")+ print(f" Similarity: {result.similarity}")++ # Clear all vectors when done+ print("\nClearing vectors...")+ ob_storage.clear()+ status = ob_storage.status()+ print(f"Vector count after clearing: {status.vector_count}")+++if __name__ == "__main__":+ main()++```+```markdown+'''+===============================================================================+Vector dimension: 4+Initial vector count: 0+Adding vectors in batches...+Vector count after adding batch: 1000+Querying similar vectors...+Result 1:+ ID: f33f008d-688a-468a-9a2d-e005d27ad9d8+ Payload: {'idx': 496, 'batch': 'example'}+ Similarity: 0.9847431876706196+Result 2:+ ID: 0946ca4a-9129-4343-b339-b2f13a64c827+ Payload: {'idx': 306, 'batch': 'example'}+ Similarity: 0.9598140307734809+Result 3:+ ID: e2505cc3-7bee-433e-a723-c830b9404f61+ Payload: {'idx': 654, 'batch': 'example'}+ Similarity: 0.9548076959468635+Result 4:+ ID: 8d6359ff-49fd-4fb7-99fd-bf4ca0a0cdcx+ Payload: {'idx': 914, 'batch': 'example'}+ Similarity: 0.9496165658207311+Result 5:+ ID: 45cef390-3e1f-4e16-8375-b4108951a93b+ Payload: {'idx': 806, 'batch': 'example'}+ Similarity: 0.9485824622759768+Clearing vectors...+Vector count after clearing: 0+===============================================================================+'''+```-### 3.6. Using `NebulaGraph`+### 3.7. Using `NebulaGraph````pythonfrom camel.storages.graph_storages import NebulaGraph@@ -250,7 +391,7 @@ query = 'SHOW TAGS;'print(nebula_graph.query(query))```-### 3.7. Using `Neo4jGraph`+### 3.8. Using `Neo4jGraph````pythonfrom camel.storages import Neo4jGraphdiff --git a/docs/mintlify/reference/camel.toolkits.async_browser_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.async_browser_toolkit.mdxindex a71d5eaef..3f5d71cdb 100644--- a/docs/mintlify/reference/camel.toolkits.async_browser_toolkit.mdx+++ b/docs/mintlify/reference/camel.toolkits.async_browser_toolkit.mdx@@ -13,181 +13,12 @@ parentheses)**Parameters:**-- **s** (str): Input string, e.g., `1.`**`click_id(14)`**, `scroll_up()`, `'visit_page(url)'`, etc.+- **s** (str): Input string, e.g., `1.`**`click_id(14)`**, `scroll_up()`, `\'visit_page(url)\'`, etc.**Returns:**str: Pure function name (e.g., `click_id`, `scroll_up`, `visit_page`)-<a id="camel.toolkits.async_browser_toolkit._get_str"></a>--## _get_str--```python-def _get_str(d: Any, k: str):-```--Safely retrieve a string value from a dictionary.--<a id="camel.toolkits.async_browser_toolkit._get_number"></a>--## _get_number--```python-def _get_number(d: Any, k: str):-```--Safely retrieve a number (int or float) from a dictionary--<a id="camel.toolkits.async_browser_toolkit._get_bool"></a>--## _get_bool--```python-def _get_bool(d: Any, k: str):-```--Safely retrieve a boolean value from a dictionary.--<a id="camel.toolkits.async_browser_toolkit._parse_json_output"></a>--## _parse_json_output--```python-def _parse_json_output(text: str):-```--Extract JSON output from a string.--<a id="camel.toolkits.async_browser_toolkit._reload_image"></a>--## _reload_image--```python-def _reload_image(image: Image.Image):-```--<a id="camel.toolkits.async_browser_toolkit.dom_rectangle_from_dict"></a>--## dom_rectangle_from_dict--```python-def dom_rectangle_from_dict(rect: Dict[str, Any]):-```--Create a DOMRectangle object from a dictionary.--<a id="camel.toolkits.async_browser_toolkit.interactive_region_from_dict"></a>--## interactive_region_from_dict--```python-def interactive_region_from_dict(region: Dict[str, Any]):-```--Create an :class:`InteractiveRegion` object from a dictionary.--<a id="camel.toolkits.async_browser_toolkit.visual_viewport_from_dict"></a>--## visual_viewport_from_dict--```python-def visual_viewport_from_dict(viewport: Dict[str, Any]):-```--Create a :class:`VisualViewport` object from a dictionary.--<a id="camel.toolkits.async_browser_toolkit.add_set_of_mark"></a>--## add_set_of_mark--```python-def add_set_of_mark(- screenshot: Union[bytes, Image.Image, io.BufferedIOBase],- ROIs: Dict[str, InteractiveRegion]-):-```--<a id="camel.toolkits.async_browser_toolkit._add_set_of_mark"></a>--## _add_set_of_mark--```python-def _add_set_of_mark(screenshot: Image.Image, ROIs: Dict[str, InteractiveRegion]):-```--Add a set of marks to the screenshot.--**Parameters:**--- **screenshot** (Image.Image): The screenshot to add marks to.-- **ROIs** (Dict[str, InteractiveRegion]): The regions to add marks to.--**Returns:**-- Tuple[Image.Image, List[str], List[str], List[str]]: A tuple-containing the screenshot with marked ROIs, ROIs fully within the-images, ROIs located above the visible area, and ROIs located below-the visible area.--<a id="camel.toolkits.async_browser_toolkit._draw_roi"></a>--## _draw_roi--```python-def _draw_roi(- draw: ImageDraw.ImageDraw,- idx: int,- font: ImageFont.FreeTypeFont | ImageFont.ImageFont,- rect: DOMRectangle-):-```--Draw a ROI on the image.--**Parameters:**--- **draw** (ImageDraw.ImageDraw): The draw object.-- **idx** (int): The index of the ROI.-- **font** (ImageFont.FreeTypeFont | ImageFont.ImageFont): The font.-- **rect** (DOMRectangle): The DOM rectangle.--<a id="camel.toolkits.async_browser_toolkit._get_text_color"></a>--## _get_text_color--```python-def _get_text_color(bg_color: Tuple[int, int, int, int]):-```--Determine the ideal text color (black or white) for contrast.--**Parameters:**--- **bg_color**: The background color (R, G, B, A).--**Returns:**-- A tuple representing black or white color for text.--<a id="camel.toolkits.async_browser_toolkit._get_random_color"></a>--## _get_random_color--```python-def _get_random_color(identifier: int):-```--Generate a consistent random RGBA color based on the identifier.--**Parameters:**--- **identifier**: The ID used as a seed to ensure color consistency.--**Returns:**-- A tuple representing (R, G, B, A) values.-<a id="camel.toolkits.async_browser_toolkit.AsyncBaseBrowser"></a>## AsyncBaseBrowserdiff --git a/docs/mintlify/reference/camel.toolkits.browser_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.browser_toolkit.mdxindex b90e3475d..f75b54c42 100644--- a/docs/mintlify/reference/camel.toolkits.browser_toolkit.mdx+++ b/docs/mintlify/reference/camel.toolkits.browser_toolkit.mdx@@ -30,145 +30,6 @@ def _get_bool(d: Any, k: str):Safely retrieve a boolean value from a dictionary.-<a id="camel.toolkits.browser_toolkit._parse_json_output"></a>--## _parse_json_output--```python-def _parse_json_output(text: str):-```--Extract JSON output from a string.--<a id="camel.toolkits.browser_toolkit._reload_image"></a>--## _reload_image--```python-def _reload_image(image: Image.Image):-```--<a id="camel.toolkits.browser_toolkit.dom_rectangle_from_dict"></a>--## dom_rectangle_from_dict--```python-def dom_rectangle_from_dict(rect: Dict[str, Any]):-```--Create a DOMRectangle object from a dictionary.--<a id="camel.toolkits.browser_toolkit.interactive_region_from_dict"></a>--## interactive_region_from_dict--```python-def interactive_region_from_dict(region: Dict[str, Any]):-```--Create an :class:`InteractiveRegion` object from a dictionary.--<a id="camel.toolkits.browser_toolkit.visual_viewport_from_dict"></a>--## visual_viewport_from_dict--```python-def visual_viewport_from_dict(viewport: Dict[str, Any]):-```--Create a :class:`VisualViewport` object from a dictionary.--<a id="camel.toolkits.browser_toolkit.add_set_of_mark"></a>--## add_set_of_mark--```python-def add_set_of_mark(- screenshot: Union[bytes, Image.Image, io.BufferedIOBase],- ROIs: Dict[str, InteractiveRegion]-):-```--<a id="camel.toolkits.browser_toolkit._add_set_of_mark"></a>--## _add_set_of_mark--```python-def _add_set_of_mark(screenshot: Image.Image, ROIs: Dict[str, InteractiveRegion]):-```--Add a set of marks to the screenshot.--**Parameters:**--- **screenshot** (Image.Image): The screenshot to add marks to.-- **ROIs** (Dict[str, InteractiveRegion]): The regions to add marks to.--**Returns:**-- Tuple[Image.Image, List[str], List[str], List[str]]: A tuple-containing the screenshot with marked ROIs, ROIs fully within the-images, ROIs located above the visible area, and ROIs located below-the visible area.--<a id="camel.toolkits.browser_toolkit._draw_roi"></a>--## _draw_roi--```python-def _draw_roi(- draw: ImageDraw.ImageDraw,- idx: int,- font: ImageFont.FreeTypeFont | ImageFont.ImageFont,- rect: DOMRectangle-):-```--Draw a ROI on the image.--**Parameters:**--- **draw** (ImageDraw.ImageDraw): The draw object.-- **idx** (int): The index of the ROI.-- **font** (ImageFont.FreeTypeFont | ImageFont.ImageFont): The font.-- **rect** (DOMRectangle): The DOM rectangle.--<a id="camel.toolkits.browser_toolkit._get_text_color"></a>--## _get_text_color--```python-def _get_text_color(bg_color: Tuple[int, int, int, int]):-```--Determine the ideal text color (black or white) for contrast.--**Parameters:**--- **bg_color**: The background color (R, G, B, A).--**Returns:**-- A tuple representing black or white color for text.--<a id="camel.toolkits.browser_toolkit._get_random_color"></a>--## _get_random_color--```python-def _get_random_color(identifier: int):-```--Generate a consistent random RGBA color based on the identifier.--**Parameters:**--- **identifier**: The ID used as a seed to ensure color consistency.--**Returns:**-- A tuple representing (R, G, B, A) values.-<a id="camel.toolkits.browser_toolkit.BaseBrowser"></a>## BaseBrowser@@ -353,7 +214,8 @@ marked.**Returns:**- Tuple[Image.Image, Union[str, None]]: A tuple containing the screenshot image+ Tuple[Image.Image, Union[str, None]]: A tuple containing the+screenshot imageand an optional path to the image file if saved, otherwise:obj:`None`.@@ -420,7 +282,6 @@ Download a file with the given selector.**Parameters:**- **identifier** (str): The identifier of the file to download.-- **file_path** (str): The path to save the downloaded file.**Returns:**@@ -594,7 +455,11 @@ def _reset(self):### _initialize_agent```python-def _initialize_agent(self):+def _initialize_agent(+ self,+ web_agent_model_backend: Optional[BaseModelBackend],+ planning_agent_model_backend: Optional[BaseModelBackend]+):```Initialize the agent.@@ -607,7 +472,8 @@ Initialize the agent.def _observe(self, task_prompt: str, detailed_plan: Optional[str] = None):```-Let agent observe the current environment, and get the next action.+Let agent observe the current environment, and get the next+action.<a id="camel.toolkits.browser_toolkit.BrowserToolkit._act"></a>@@ -636,8 +502,11 @@ the action was successful, and the information to be returned.def _get_final_answer(self, task_prompt: str):```-Get the final answer based on the task prompt and current browser state.-It is used when the agent thinks that the task can be completed without any further action, and answer can be directly found in the current viewport.+Get the final answer based on the task prompt and current+browser state.+It is used when the agent thinks that the task can be completed+without any further action, and answer can be directly found in the+current viewport.<a id="camel.toolkits.browser_toolkit.BrowserToolkit._task_planning"></a>@@ -666,7 +535,8 @@ Replan the task based on the given task prompt.**Returns:**- Tuple[bool, str]: A tuple containing a boolean indicating whether the task needs to be replanned, and the replanned schema.+ Tuple[bool, str]: A tuple containing a boolean indicating+whether the task needs to be replanned, and the replanned schema.<a id="camel.toolkits.browser_toolkit.BrowserToolkit.browse_url"></a>diff --git a/docs/mintlify/reference/camel.toolkits.browser_toolkit_commons.mdx b/docs/mintlify/reference/camel.toolkits.browser_toolkit_commons.mdxnew file mode 100644index 000000000..2ee0c963a--- /dev/null+++ b/docs/mintlify/reference/camel.toolkits.browser_toolkit_commons.mdx@@ -0,0 +1,170 @@+<a id="camel.toolkits.browser_toolkit_commons"></a>++<a id="camel.toolkits.browser_toolkit_commons._get_str"></a>++## _get_str++```python+def _get_str(d: Any, k: str):+```++Safely retrieve a string value from a dictionary.++<a id="camel.toolkits.browser_toolkit_commons._get_number"></a>++## _get_number++```python+def _get_number(d: Any, k: str):+```++Safely retrieve a number (int or float) from a dictionary++<a id="camel.toolkits.browser_toolkit_commons._get_bool"></a>++## _get_bool++```python+def _get_bool(d: Any, k: str):+```++Safely retrieve a boolean value from a dictionary.++<a id="camel.toolkits.browser_toolkit_commons._parse_json_output"></a>++## _parse_json_output++```python+def _parse_json_output(text: str, logger: Any):+```++Extract JSON output from a string.++<a id="camel.toolkits.browser_toolkit_commons._reload_image"></a>++## _reload_image++```python+def _reload_image(image: Image.Image):+```++<a id="camel.toolkits.browser_toolkit_commons.dom_rectangle_from_dict"></a>++## dom_rectangle_from_dict++```python+def dom_rectangle_from_dict(rect: Dict[str, Any]):+```++Create a DOMRectangle object from a dictionary.++<a id="camel.toolkits.browser_toolkit_commons.interactive_region_from_dict"></a>++## interactive_region_from_dict++```python+def interactive_region_from_dict(region: Dict[str, Any]):+```++Create an :class:`InteractiveRegion` object from a dictionary.++<a id="camel.toolkits.browser_toolkit_commons.visual_viewport_from_dict"></a>++## visual_viewport_from_dict++```python+def visual_viewport_from_dict(viewport: Dict[str, Any]):+```++Create a :class:`VisualViewport` object from a dictionary.++<a id="camel.toolkits.browser_toolkit_commons.add_set_of_mark"></a>++## add_set_of_mark++```python+def add_set_of_mark(+ screenshot: Union[bytes, Image.Image, io.BufferedIOBase],+ ROIs: Dict[str, InteractiveRegion]+):+```++<a id="camel.toolkits.browser_toolkit_commons._add_set_of_mark"></a>++## _add_set_of_mark++```python+def _add_set_of_mark(screenshot: Image.Image, ROIs: Dict[str, InteractiveRegion]):+```++Add a set of marks to the screenshot.++**Parameters:**++- **screenshot** (Image.Image): The screenshot to add marks to.+- **ROIs** (Dict[str, InteractiveRegion]): The regions to add marks to.++**Returns:**++ Tuple[Image.Image, List[str], List[str], List[str]]: A tuple+containing the screenshot with marked ROIs, ROIs fully within the+images, ROIs located above the visible area, and ROIs located below+the visible area.++<a id="camel.toolkits.browser_toolkit_commons._draw_roi"></a>++## _draw_roi++```python+def _draw_roi(+ draw: ImageDraw.ImageDraw,+ idx: int,+ font: Union[ImageFont.FreeTypeFont, ImageFont.ImageFont],+ rect: DOMRectangle+):+```++Draw a ROI on the image.++**Parameters:**++- **draw** (ImageDraw.ImageDraw): The draw object.+- **idx** (int): The index of the ROI.+- **font** (ImageFont.FreeTypeFont | ImageFont.ImageFont): The font.+- **rect** (DOMRectangle): The DOM rectangle.++<a id="camel.toolkits.browser_toolkit_commons._get_text_color"></a>++## _get_text_color++```python+def _get_text_color(bg_color: Tuple[int, int, int, int]):+```++Determine the ideal text color (black or white) for contrast.++**Parameters:**++- **bg_color**: The background color (R, G, B, A).++**Returns:**++ A tuple representing black or white color for text.++<a id="camel.toolkits.browser_toolkit_commons._get_random_color"></a>++## _get_random_color++```python+def _get_random_color(identifier: int):+```++Generate a consistent random RGBA color based on the identifier.++**Parameters:**++- **identifier**: The ID used as a seed to ensure color consistency.++**Returns:**++ A tuple representing (R, G, B, A) values.diff --git a/docs/mintlify/reference/camel.toolkits.file_write_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.file_write_toolkit.mdxindex 56aa75a2a..a15ab7662 100644--- a/docs/mintlify/reference/camel.toolkits.file_write_toolkit.mdx+++ b/docs/mintlify/reference/camel.toolkits.file_write_toolkit.mdx@@ -120,7 +120,7 @@ def _write_pdf_file(self,file_path: Path,content: str,- **kwargs+ use_latex: bool = False):```@@ -130,6 +130,7 @@ Write text content to a PDF file with default formatting.- **file_path** (Path): The target file path.- **content** (str): The text content to write.+- **use_latex** (bool): Whether to use LaTeX for rendering. (requires LaTeX toolchain). If False, uses FPDF for simpler PDF generation. (default: :obj: `False`)<a id="camel.toolkits.file_write_toolkit.FileWriteToolkit._write_csv_file"></a>@@ -245,7 +246,8 @@ def write_to_file(self,content: Union[str, List[List[str]]],filename: str,- encoding: Optional[str] = None+ encoding: Optional[str] = None,+ use_latex: bool = False):```@@ -261,6 +263,7 @@ and HTML (.html, .htm).- **content** (Union[str, List[List[str]]]): The content to write to the file. For all formats, content must be a string or list in the appropriate format.- **filename** (str): The name or path of the file. If a relative path is supplied, it is resolved to self.output_dir.- **encoding** (Optional[str]): The character encoding to use. (default: :obj: `None`)+- **use_latex** (bool): For PDF files, whether to use LaTeX rendering (True) or simple FPDF rendering (False). (default: :obj: `False`)**Returns:**diff --git a/pyproject.toml b/pyproject.tomlindex 555b07480..a89a673e2 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -389,7 +389,6 @@ default-groups = [[tool.uv.sources]bohrium = { git = "https://github.com/dptech-corp/bohrium-openapi-python-sdk" }-bohrium_api = { git = "https://github.com/dptech-corp/bohrium-openapi-python-sdk" }[tool.hatch.build.targets.sdist]include = ["camel"]@@ -397,6 +396,9 @@ include = ["camel"][tool.hatch.build.targets.wheel]include = ["camel"]+[tool.hatch.metadata]+allow-direct-references = true+[tool.ruff]line-length = 79fix = true