Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

Auto-update documentation after merge

GitHub Action4f51841bf887
diff --git a/docs/mintlify/cookbooks/advanced_features/agents_tracking.mdx b/docs/mintlify/cookbooks/advanced_features/agents_tracking.mdx
index 4b34c7b1b..92a3cd8c3 100644
--- a/docs/mintlify/cookbooks/advanced_features/agents_tracking.mdx
+++ b/docs/mintlify/cookbooks/advanced_features/agents_tracking.mdx
@@ -16,7 +16,7 @@ First, install the CAMEL and AgentOps package with all its dependencies:
```python
-%pip install camel-ai[all]==0.2.18
+%pip install camel-ai[all]==0.2.16
%pip install agentops==0.3.10
```
@@ -89,7 +89,7 @@ Set one Agent with Search Tools
```python
# Define system message
sys_msg = BaseMessage.make_assistant_message(
- role_name='Tools calling opertor', content='You are a helpful assistant '
+ role_name='Tools calling opertor', content='You are a helpful assistant.'
)
# Set model config
@@ -152,7 +152,7 @@ Initialize AgentOps, you need to import toolkits after init of agentops so that
```python
-agentops.start_session(tags=["CAMEL X AgentOps Multi-agent with Tools"])
+agentops.start_session(tags=["CAMEL X AgentOps Multi-agent with Tools."])
from camel.toolkits import (
SearchToolkit,
diff --git a/docs/mintlify/cookbooks/data_processing/agent_with_chunkr_for_pdf_parsing.mdx b/docs/mintlify/cookbooks/data_processing/agent_with_chunkr_for_pdf_parsing.mdx
index 8f17f0a4e..df020711c 100644
--- a/docs/mintlify/cookbooks/data_processing/agent_with_chunkr_for_pdf_parsing.mdx
+++ b/docs/mintlify/cookbooks/data_processing/agent_with_chunkr_for_pdf_parsing.mdx
@@ -152,6 +152,8 @@ Step 3: Submit one task.
# Importing the ChunkrReader class from the camel.loaders module
# This class handles document processing using Chunkr's capabilities
from camel.loaders import ChunkrReader
+import nest_asyncio
+nest_asyncio.apply()
# Initializing an instance of ChunkrReader
# This object will be used to submit tasks and manage document processing
@@ -159,7 +161,7 @@ chunkr_reader = ChunkrReader()
# Submitting a document processing task
# Replace "local_data/example.pdf" with the path to your target document
-chunkr_reader.submit_task(file_path="local_data/camel_paper.pdf")
+await chunkr_reader.submit_task(file_path="local_data/camel_paper.pdf")
```
Step 4: Input the task id above and then we can obtain the task output.
@@ -177,8 +179,7 @@ The output of Chunkr is structured text and metadata from documents, including:
```python
# Retrieving the output of a previously submitted task
-# The "max_retries" parameter determines the number of times to retry if the task output is not immediately available
-chunkr_output = chunkr_reader.get_task_output(task_id="902e686a-d6f5-413d-8a8d-241a3f43d35b", max_retries=10)
+chunkr_output = await chunkr_reader.get_task_output(task_id="902e686a-d6f5-413d-8a8d-241a3f43d35b")
print(chunkr_output)
```
diff --git a/docs/mintlify/cookbooks/data_processing/summarisation_agent_with_mistral_ocr.mdx b/docs/mintlify/cookbooks/data_processing/summarisation_agent_with_mistral_ocr.mdx
index 64df14a7f..ba140412b 100644
--- a/docs/mintlify/cookbooks/data_processing/summarisation_agent_with_mistral_ocr.mdx
+++ b/docs/mintlify/cookbooks/data_processing/summarisation_agent_with_mistral_ocr.mdx
@@ -4,7 +4,7 @@ title: "Create Document Summarization Agents with Mistral OCR & CAMEL-AI 🐫"
You can also check this cookbook in Colab [here](https://colab.research.google.com/drive/1ZwVmqa5vjpZ0C3H7k1XIseFfbCR4mq17?usp=sharing)
-In this cookbook, we'll explore [**Mistral OCR**](https://mistral.ai/news/mistral-ocr)—a state-of-the-art Optical Character Recognition API that understands complex document layouts and extracts text, tables, images, and equations with unprecedented accuracy. We'll show you how to:
+In this cookbook, we’ll explore [**Mistral OCR**](https://mistral.ai/news/mistral-ocr)—a state-of-the-art Optical Character Recognition API that understands complex document layouts and extracts text, tables, images, and equations with unprecedented accuracy. We’ll show you how to:
- Use the Mistral OCR API to convert scanned or image-based PDFs into structured Markdown
- Leverage a Mistral LLM agent within CAMEL to summarize and analyze the extracted content
@@ -18,14 +18,16 @@ In this cookbook, we'll explore [**Mistral OCR**](https://mistral.ai/news/mistra
4. 🧑🏻‍💻 Conclusion
<div class="align-center">
- <a href="https://www.camel-ai.org/"><img src="https://i.postimg.cc/KzQ5rfBC/button.png" width="150" /></a>
- <a href="https://discord.camel-ai.org"><img src="https://i.postimg.cc/L4wPdG9N/join-2.png" width="150" /></a>
-</div>
+ <a href="https://www.camel-ai.org/"><img src="https://i.postimg.cc/KzQ5rfBC/button.png" width="150"></a>
+ <a href="https://discord.camel-ai.org"><img src="https://i.postimg.cc/L4wPdG9N/join-2.png" width="150"></a>
+
⭐ *Star us on [GitHub](https://github.com/camel-ai/camel), join our [Discord](https://discord.camel-ai.org), or follow us on [X](https://x.com/camelaiorg)*
---
+
+
![Slide 16_9 - 33.png](./images/summarisation_agent_with_mistral_ocr_1.png)
## **Introduction to Mistral OCR**
@@ -47,9 +49,9 @@ Throughout history, advancements in information abstraction and retrieval have d
- Outperforms leading OCR systems in accuracy—especially in math, tables, and multilingual tests—while delivering fast batch inference (∼2000 pages/min).
5. **Scalable & flexible deployment**
- - Available via `mistral-ocr-latest` on Mistral's developer suite, cloud partners, and on-premises self-hosting for sensitive data.
+ - Available via `mistral-ocr-latest` on Mistral’s developer suite, cloud partners, and on-premises self-hosting for sensitive data.
-Ready to unlock your documents? Let's dive into the extraction guide.
+Ready to unlock your documents? Let’s dive into the extraction guide.
First, install the CAMEL package with all its dependencies.
@@ -63,7 +65,7 @@ First, install the CAMEL package with all its dependencies.
**Step 1: Set up your Mistral API key**
-If you don't have a Mistral API key, you can obtain one by following these steps:
+If you don’t have a Mistral API key, you can obtain one by following these steps:
1. **Create an account:**
Go to [Mistral Console](https://console.mistral.ai/home) and sign up for an organization account.
@@ -177,10 +179,10 @@ print(response.msgs[0].content)
## 🧑🏻‍💻 Conclusion
-In conclusion, integrating **Mistral OCR** within CAMEL-AI revolutionizes the process of document data extraction and preparation, enhancing your capabilities for AI-driven applications. With Mistral OCR's robust features—state-of-the-art complex document understanding, natively multilingual & multimodal parsing, and doc-as-prompt structured Markdown output—you can seamlessly process complex PDFs and images into machine-readable formats optimized for LLMs, directly feeding into CAMEL-AI's multi-agent workflows. This integration not only simplifies data preparation but also empowers intelligent and accurate analytics at scale. With these tools at your disposal, you're equipped to transform raw document data into actionable insights, unlocking new possibilities in automation and AI-powered decision-making.
+In conclusion, integrating **Mistral OCR** within CAMEL-AI revolutionizes the process of document data extraction and preparation, enhancing your capabilities for AI-driven applications. With Mistral OCR’s robust features—state-of-the-art complex document understanding, natively multilingual & multimodal parsing, and doc-as-prompt structured Markdown output—you can seamlessly process complex PDFs and images into machine-readable formats optimized for LLMs, directly feeding into CAMEL-AI’s multi-agent workflows. This integration not only simplifies data preparation but also empowers intelligent and accurate analytics at scale. With these tools at your disposal, you’re equipped to transform raw document data into actionable insights, unlocking new possibilities in automation and AI-powered decision-making.
-That's everything: Got questions about 🐫 CAMEL-AI? Join us on [Discord](https://discord.camel-ai.org)! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we'd love to have you in the community! 🤝
+That's everything: Got questions about 🐫 CAMEL-AI? Join us on [Discord](https://discord.camel-ai.org)! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we’d love to have you in the community! 🤝
Check out some of our other work:
@@ -199,11 +201,13 @@ Thanks from everyone at 🐫 CAMEL-AI
<div style={{ display: "flex", justifyContent: "center", alignItems: "center", gap: "1rem", marginBottom: "2rem" }}>
<a href="https://www.camel-ai.org/">
- <img src="https://i.postimg.cc/KzQ5rfBC/button.png" width="150" alt="CAMEL Homepage" />
+ <img src="https://i.postimg.cc/KzQ5rfBC/button.png" width="150" alt="CAMEL Homepage"/>
</a>
<a href="https://discord.camel-ai.org">
- <img src="https://i.postimg.cc/L4wPdG9N/join-2.png" width="150" alt="Join Discord" />
+ <img src="https://i.postimg.cc/L4wPdG9N/join-2.png" width="150" alt="Join Discord"/>
</a>
-</div>
+</div>
+
+⭐ *Star us on [GitHub](https://github.com/camel-ai/camel), join our [Discord](https://discord.camel-ai.org), or follow us on [X](https://x.com/camelaiorg)*
+
-⭐ *Star us on [GitHub](https://github.com/camel-ai/camel), join our [Discord](https://discord.camel-ai.org), or follow us on [X](https://x.com/camelaiorg)*
\ No newline at end of file
diff --git a/docs/mintlify/cookbooks/mcp/agents_with_sql_mcp.mdx b/docs/mintlify/cookbooks/mcp/agents_with_sql_mcp.mdx
index 9a475d2d8..56a9eba20 100644
--- a/docs/mintlify/cookbooks/mcp/agents_with_sql_mcp.mdx
+++ b/docs/mintlify/cookbooks/mcp/agents_with_sql_mcp.mdx
@@ -35,7 +35,7 @@ First, install the CAMEL package with all its dependencies:
```python
-%pip install "camel-ai[all]==0.2.57"
+%pip install "camel-ai[all]==0.2.62"
```
## 🔑 Setting Up API Keys
@@ -56,15 +56,15 @@ Create a file named `mcp_config.json` with the following content:
```json
{
- "servers": [
- {
+ "mcpServers": {
+ "sql_server": {
"type": "script",
"command": "python",
"args": ["sql_server_mcp.py"],
"transport": "stdio"
}
- ]
-}
+ }
+}
```
This configuration tells CAMEL how to start and communicate with your SQL MCP server.
@@ -225,9 +225,8 @@ async def main():
mcp_toolkit = MCPToolkit(config_path=str(config_file_path))
- tools = None
- async with mcp_toolkit.connection() as toolkit_connection:
- tools = toolkit_connection.get_tools()
+ await mcp_toolkit.connect()
+ tools = mcp_toolkit.get_tools()
# Get API key securely from user input
openrouter_api_key = getpass('Enter your OpenRouter API key: ')
@@ -238,7 +237,7 @@ async def main():
try:
model = ModelFactory.create(
model_platform=ModelPlatformType.OPENROUTER,
- model_type="anthropic/claude-3.7-sonnet",
+ model_type="google/gemini-2.5-pro-preview",
api_key=openrouter_api_key,
model_config_dict={
"temperature": 0.2,
@@ -297,6 +296,8 @@ async def main():
except Exception as e:
logger.error(f"An error occurred: {str(e)}")
print(f"\nError: {str(e)}")
+ finally:
+ await mcp_toolkit.disconnect() # final cleanup
if __name__ == "__main__":
diff --git a/docs/mintlify/key_modules/interpreters.mdx b/docs/mintlify/key_modules/interpreters.mdx
index b2e9654ab..a88f7f4a0 100644
--- a/docs/mintlify/key_modules/interpreters.mdx
+++ b/docs/mintlify/key_modules/interpreters.mdx
@@ -6,7 +6,7 @@ title: "Interpreters"
Interpreters are tools that empower agents to execute given code snippets on the local machine or in isolated environments. CAMEL supports several types of interpreters to cater to different needs and security considerations.
### 1.1. Internal Python Interpreter
-The Internal Python Interpreter executes Python code directly within the same process as the agent. This is the simplest interpreter and is suitable for trusted code execution. In its default (safe) mode, it evaluates expressions and executes statements in a controlled environment; `print()` is not directly available as a side effect, so code should evaluate to a string for output
+The Internal Python Interpreter executes Python code directly within the same process as the agent. This is the simplest interpreter and is suitable for trusted code execution. In its default (safe) mode, it evaluates expressions and executes statements in a controlled environment; `print()` is not directly available as a side effect, so code should evaluate to a string for output.
**Example Usage:**
```python
diff --git a/docs/mintlify/key_modules/loaders.mdx b/docs/mintlify/key_modules/loaders.mdx
index b2d7a78fa..a81ce7f25 100644
--- a/docs/mintlify/key_modules/loaders.mdx
+++ b/docs/mintlify/key_modules/loaders.mdx
@@ -4,7 +4,7 @@ title: "Loaders"
## 1. Concept
CAMEL introduced two IO modules, `Base IO` and `Unstructured IO` which are designed for handling various file types and unstructured data processing.
-Additionally, four new data readers were added, `Apify Reader`,`Chunkr Reader`, `Firecrawl Reader`, and `Jina_url Reader`, which enable retrieval of external data for improved data integration and analysis.
+Additionally, several data readers were added, including `Apify Reader`, `Chunkr Reader`, `Firecrawl Reader`, `Jina_url Reader`, and `Mistral Reader`, which enable retrieval of external data for improved data integration and analysis.
## 2. Types
@@ -30,6 +30,9 @@ JinaURL Reader is a Python client for Jina AI's URL reading service, optimized t
### 2.7 MarkitDown Reader
MarkItDown is a lightweight Python utility for converting various files to Markdown for use with LLMs and related text analysis pipelines.
+### 2.8 Mistral Reader
+Mistral Reader is a Python client for interacting with Mistral AI's OCR service, which can extract text from PDFs and images. It provides capabilities to process both local files and remote URLs, supporting various file formats.
+
## 3. Get Started
### 3.1. Using `Base IO`
@@ -323,7 +326,6 @@ print(response)
```markdown
>>>Welcome to CAMEL’s documentation! — CAMEL 0.2.61 documentation
-===============
[Skip to main content](https://docs.camel-ai.org/#main-content)
@@ -349,3 +351,46 @@ Key Modules
* [Models](https://docs.camel-ai...)
```
+
+### 3.7. Using `Mistral Reader`
+
+Initialize the Mistral Reader client with your API key (or it will use the MISTRAL_API_KEY environment variable) and extract text from a PDF URL:
+
+```python
+from camel.loaders import MistralReader
+
+mistral_reader = MistralReader()
+
+# Extract text from a PDF URL
+url_ocr_response = mistral_reader.extract_text(
+ file_path="https://arxiv.org/pdf/2201.04234", pages=[5]
+)
+print(url_ocr_response)
+```
+
+Extract text from an image URL by setting `is_image=True`:
+
+```python
+# Extract text from an image URL
+image_ocr_response = mistral_reader.extract_text(
+ file_path="https://raw.githubusercontent.com/mistralai/cookbook/refs/heads/main/mistral/ocr/receipt.png",
+ is_image=True,
+)
+print(image_ocr_response)
+```
+
+Process a local PDF file:
+
+```python
+# Extract text from a local PDF file
+local_ocr_response = mistral_reader.extract_text("path/to/your/document.pdf")
+print(local_ocr_response)
+```
+
+The response contains structured information about the extracted text, including the markdown-formatted content, page dimensions, and usage information:
+
+```markdown
+>>>pages=[OCRPageObject(index=5, markdown='![img-0.jpeg](./images/img-0.jpeg)\n\nFigure 2: Scatter plot of predicted accuracy versus (true) OOD accuracy. Each point denotes a dif...',
+
+images=[OCRImageObject(id='img-0.jpeg', top_left_x=294, top_left_y=180, bottom_right_x=1387, bottom_right_y=558, image_base64=None, image_annotation=None)], dimensions=OCRPageDimensions(dpi=200, height=2200, width=1700))] model='mistral-ocr-2505-completion' usage_info=OCRUsageInfo(pages_processed=1, doc_size_bytes=3002783) document_annotation=None
+```
diff --git a/docs/mintlify/key_modules/tools.mdx b/docs/mintlify/key_modules/tools.mdx
index aa77d3de5..ac4c7f511 100644
--- a/docs/mintlify/key_modules/tools.mdx
+++ b/docs/mintlify/key_modules/tools.mdx
@@ -179,6 +179,7 @@ CAMEL provides a variety of built-in toolkits that you can use right away. Here'
| NotionToolkit | A toolkit for retrieving information from Notion pages and workspaces using the Notion API. |
| OpenAPIToolkit | A toolkit for working with OpenAPI specifications and REST APIs. |
| OpenBBToolkit | A toolkit for accessing and analyzing financial market data through the OpenBB Platform, including stocks, ETFs, cryptocurrencies, and economic indicators. |
+| PPTXToolkit | A toolkit for creating and manipulating PowerPoint (PPTX) files, including adding slides, text, and images. |
| PubMedToolkit | A toolkit for interacting with PubMed's E-utilities API to access MEDLINE data. |
| RedditToolkit | A toolkit for Reddit operations including collecting top posts, performing sentiment analysis on comments, and tracking keyword discussions. |
| RetrievalToolkit | A toolkit for retrieving information from local vector storage systems based on specified queries. |