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 [skip ci]

camel-docs-botb8cc4cc7b918
diff --git a/docs/mintlify/docs.json b/docs/mintlify/docs.json
index 374c34f0b..e09e23ca5 100644
--- a/docs/mintlify/docs.json
+++ b/docs/mintlify/docs.json
@@ -766,4 +766,4 @@
"measurementId": "G-XV5VXFS2RG"
}
}
-}
+}
\ No newline at end of file
diff --git a/docs/mintlify/reference/camel.agents.chat_agent.mdx b/docs/mintlify/reference/camel.agents.chat_agent.mdx
index 3fecd4dfe..5805742fd 100644
--- a/docs/mintlify/reference/camel.agents.chat_agent.mdx
+++ b/docs/mintlify/reference/camel.agents.chat_agent.mdx
@@ -1453,7 +1453,7 @@ intermediate responses as they are generated.
- **input_message** (Union[BaseMessage, str]): The input message for the agent.
- **response_format** (Optional[Type[BaseModel]], optional): A Pydantic model defining the expected structure of the response.
-- **Yields**:
+- **Yields**:
- **ChatAgentResponse**: Intermediate responses containing partial content, tool calls, and other information as they become available.
<a id="camel.agents.chat_agent.ChatAgent._get_token_count"></a>
diff --git a/docs/mintlify/reference/camel.loaders.firecrawl_reader.mdx b/docs/mintlify/reference/camel.loaders.firecrawl_reader.mdx
index 5a0d0c047..f3ab33002 100644
--- a/docs/mintlify/reference/camel.loaders.firecrawl_reader.mdx
+++ b/docs/mintlify/reference/camel.loaders.firecrawl_reader.mdx
@@ -14,7 +14,7 @@ Firecrawl allows you to turn entire websites into LLM-ready markdown.
- **api_key** (Optional[str]): API key for authenticating with the Firecrawl API.
- **api_url** (Optional[str]): Base URL for the Firecrawl API.
-- **References**:
+- **References**:
- **https**: //docs.firecrawl.dev/introduction
<a id="camel.loaders.firecrawl_reader.Firecrawl.__init__"></a>
diff --git a/docs/mintlify/reference/camel.loaders.jina_url_reader.mdx b/docs/mintlify/reference/camel.loaders.jina_url_reader.mdx
index 4a726e233..bcb5868eb 100644
--- a/docs/mintlify/reference/camel.loaders.jina_url_reader.mdx
+++ b/docs/mintlify/reference/camel.loaders.jina_url_reader.mdx
@@ -18,7 +18,7 @@ replace the UnstructuredIO URL Reader in the pipeline.
- **return_format** (ReturnFormat, optional): The level of detail of the returned content, which is optimized for LLMs. For now screenshots are not supported. Defaults to ReturnFormat.DEFAULT.
- **json_response** (bool, optional): Whether to return the response in JSON format. Defaults to False.
- **timeout** (int, optional): The maximum time in seconds to wait for the page to be rendered. Defaults to 30. **kwargs (Any): Additional keyword arguments, including proxies, cookies, etc. It should align with the HTTP Header field and value pairs listed in the reference.
-- **References**:
+- **References**:
- **https**: //jina.ai/reader
<a id="camel.loaders.jina_url_reader.JinaURLReader.__init__"></a>
diff --git a/docs/mintlify/reference/camel.loaders.scrapegraph_reader.mdx b/docs/mintlify/reference/camel.loaders.scrapegraph_reader.mdx
index 39bbb7ce2..5834f25db 100644
--- a/docs/mintlify/reference/camel.loaders.scrapegraph_reader.mdx
+++ b/docs/mintlify/reference/camel.loaders.scrapegraph_reader.mdx
@@ -14,7 +14,7 @@ searching.
**Parameters:**
- **api_key** (Optional[str]): API key for authenticating with the ScrapeGraphAI API.
-- **References**:
+- **References**:
- **https**: //scrapegraph.ai/
<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.__init__"></a>
diff --git a/docs/mintlify/reference/camel.models.aws_bedrock_model.mdx b/docs/mintlify/reference/camel.models.aws_bedrock_model.mdx
index c03b3e431..66c018a8f 100644
--- a/docs/mintlify/reference/camel.models.aws_bedrock_model.mdx
+++ b/docs/mintlify/reference/camel.models.aws_bedrock_model.mdx
@@ -20,7 +20,7 @@ AWS Bedrock API in a unified OpenAICompatibleModel interface.
- **token_counter** (BaseTokenCounter, optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
-- **References**:
+- **References**:
- **https**: //docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html
<a id="camel.models.aws_bedrock_model.AWSBedrockModel.__init__"></a>
diff --git a/docs/mintlify/reference/camel.models.azure_openai_model.mdx b/docs/mintlify/reference/camel.models.azure_openai_model.mdx
index 33c48bc45..cb881f1b6 100644
--- a/docs/mintlify/reference/camel.models.azure_openai_model.mdx
+++ b/docs/mintlify/reference/camel.models.azure_openai_model.mdx
@@ -25,7 +25,7 @@ Azure OpenAI API in a unified BaseModelBackend interface.
- **client** (Optional[Any], optional): A custom synchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. Useful for RL frameworks like AReaL or rLLM that provide Azure OpenAI-compatible clients. The client should implement the AzureOpenAI client interface with `.chat.completions.create()` and `.beta.chat.completions.parse()` methods. (default: :obj:`None`)
- **async_client** (Optional[Any], optional): A custom asynchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. The client should implement the AsyncAzureOpenAI client interface. (default: :obj:`None`)
- **azure_deployment_name** (Optional[str], optional): **Deprecated**. Use `model_type` parameter instead. This parameter is kept for backward compatibility and will be removed in a future version. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the client initialization. Ignored if custom clients are provided.
-- **References**:
+- **References**:
- **https**: //learn.microsoft.com/en-us/azure/ai-services/openai/
<a id="camel.models.azure_openai_model.AzureOpenAIModel.__init__"></a>
diff --git a/docs/mintlify/reference/camel.models.deepseek_model.mdx b/docs/mintlify/reference/camel.models.deepseek_model.mdx
index 3ddde463d..515c27f71 100644
--- a/docs/mintlify/reference/camel.models.deepseek_model.mdx
+++ b/docs/mintlify/reference/camel.models.deepseek_model.mdx
@@ -19,7 +19,7 @@ DeepSeek API in a unified OpenAICompatibleModel interface.
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter` will be used. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
-- **References**:
+- **References**:
- **https**: //api-docs.deepseek.com/
<a id="camel.models.deepseek_model.DeepSeekModel.__init__"></a>
diff --git a/docs/mintlify/reference/camel.models.ollama_model.mdx b/docs/mintlify/reference/camel.models.ollama_model.mdx
index 120869374..998f1203b 100644
--- a/docs/mintlify/reference/camel.models.ollama_model.mdx
+++ b/docs/mintlify/reference/camel.models.ollama_model.mdx
@@ -20,7 +20,7 @@ Ollama service interface.
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
-- **References**:
+- **References**:
- **https**: //github.com/ollama/ollama/blob/main/docs/openai.md
<a id="camel.models.ollama_model.OllamaModel.__init__"></a>
diff --git a/docs/mintlify/reference/camel.models.vllm_model.mdx b/docs/mintlify/reference/camel.models.vllm_model.mdx
index e094621b1..94f9d9b80 100644
--- a/docs/mintlify/reference/camel.models.vllm_model.mdx
+++ b/docs/mintlify/reference/camel.models.vllm_model.mdx
@@ -19,7 +19,7 @@ vLLM service interface.
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
-- **References**:
+- **References**:
- **https**: //docs.vllm.ai/en/latest/serving/openai_compatible_server.html
<a id="camel.models.vllm_model.VLLMModel.__init__"></a>
diff --git a/docs/mintlify/reference/camel.retrievers.bm25_retriever.mdx b/docs/mintlify/reference/camel.retrievers.bm25_retriever.mdx
index e0d782cd4..80674920e 100644
--- a/docs/mintlify/reference/camel.retrievers.bm25_retriever.mdx
+++ b/docs/mintlify/reference/camel.retrievers.bm25_retriever.mdx
@@ -19,7 +19,7 @@ frequency of the query terms.
- **bm25** (BM25Okapi): An instance of the BM25Okapi class used for calculating document scores.
- **content_input_path** (str): The path to the content that has been processed and stored.
- **unstructured_modules** (UnstructuredIO): A module for parsing files and URLs and chunking content based on specified parameters.
-- **References**:
+- **References**:
- **https**: //github.com/dorianbrown/rank_bm25
<a id="camel.retrievers.bm25_retriever.BM25Retriever.__init__"></a>
diff --git a/docs/mintlify/reference/camel.retrievers.cohere_rerank_retriever.mdx b/docs/mintlify/reference/camel.retrievers.cohere_rerank_retriever.mdx
index f04ee8cd1..692844e38 100644
--- a/docs/mintlify/reference/camel.retrievers.cohere_rerank_retriever.mdx
+++ b/docs/mintlify/reference/camel.retrievers.cohere_rerank_retriever.mdx
@@ -15,7 +15,7 @@ model.
- **model_name** (str): The model name to use for re-ranking.
- **api_key** (Optional[str]): The API key for authenticating with the Cohere service.
-- **References**:
+- **References**:
- **https**: //txt.cohere.com/rerank/
<a id="camel.retrievers.cohere_rerank_retriever.CohereRerankRetriever.__init__"></a>
diff --git a/docs/mintlify/reference/camel.storages.key_value_storages.mem0_cloud.mdx b/docs/mintlify/reference/camel.storages.key_value_storages.mem0_cloud.mdx
index f0a6d7043..00282663c 100644
--- a/docs/mintlify/reference/camel.storages.key_value_storages.mem0_cloud.mdx
+++ b/docs/mintlify/reference/camel.storages.key_value_storages.mem0_cloud.mdx
@@ -18,7 +18,7 @@ search, and manage text with context.
- **api_key** (str, optional): The API key for authentication. If not provided, will try to get from environment variable MEM0_API_KEY (default: :obj:`None`).
- **user_id** (str, optional): Default user ID to associate memories with (default: :obj:`None`).
- **metadata** (Dict[str, Any], optional): Default metadata to include with all memories (default: :obj:`None`).
-- **References**:
+- **References**:
- **https**: //docs.mem0.ai
<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage.__init__"></a>
diff --git a/docs/mintlify/reference/camel.storages.object_storages.amazon_s3.mdx b/docs/mintlify/reference/camel.storages.object_storages.amazon_s3.mdx
index 06b48cfaa..1e77af5cc 100644
--- a/docs/mintlify/reference/camel.storages.object_storages.amazon_s3.mdx
+++ b/docs/mintlify/reference/camel.storages.object_storages.amazon_s3.mdx
@@ -22,7 +22,7 @@ logged in with AWS CLI).
- **access_key_id** (Optional[str], optional): The AWS access key ID. Defaults to None.
- **secret_access_key** (Optional[str], optional): The AWS secret access key. Defaults to None.
- **anonymous** (bool, optional): Whether to use anonymous access. Defaults to False.
-- **References**:
+- **References**:
- **https**: //aws.amazon.com/pm/serv-s3/
- **https**: //aws.amazon.com/cli/
diff --git a/docs/mintlify/reference/camel.storages.object_storages.azure_blob.mdx b/docs/mintlify/reference/camel.storages.object_storages.azure_blob.mdx
index ea16da013..d785edb61 100644
--- a/docs/mintlify/reference/camel.storages.object_storages.azure_blob.mdx
+++ b/docs/mintlify/reference/camel.storages.object_storages.azure_blob.mdx
@@ -16,7 +16,7 @@ container in the storage account.
- **storage_account_name** (str): The name of the storage account.
- **container_name** (str): The name of the container.
- **access_key** (Optional[str], optional): The access key of the storage account. Defaults to None.
-- **References**:
+- **References**:
- **https**: //azure.microsoft.com/en-us/products/storage/blobs
<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage.__init__"></a>
diff --git a/docs/mintlify/reference/camel.storages.object_storages.google_cloud.mdx b/docs/mintlify/reference/camel.storages.object_storages.google_cloud.mdx
index fc5014378..eee8cf59d 100644
--- a/docs/mintlify/reference/camel.storages.object_storages.google_cloud.mdx
+++ b/docs/mintlify/reference/camel.storages.object_storages.google_cloud.mdx
@@ -20,7 +20,7 @@ line tool and save the credentials first.
- **bucket_name** (str): The name of the bucket.
- **create_if_not_exists** (bool, optional): Whether to create the bucket if it does not exist. Defaults to True.
- **anonymous** (bool, optional): Whether to use anonymous access. Defaults to False.
-- **References**:
+- **References**:
- **https**: //cloud.google.com/storage
- **https**: //cloud.google.com/docs/authentication/api-keys
diff --git a/docs/mintlify/reference/camel.toolkits.wechat_official_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.wechat_official_toolkit.mdx
index 429c2da03..c2e53b60c 100644
--- a/docs/mintlify/reference/camel.toolkits.wechat_official_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.wechat_official_toolkit.mdx
@@ -15,7 +15,7 @@ def _get_wechat_access_token():
**Raises:**
- **ValueError**: If credentials are missing or token retrieval fails.
-- **References**:
+- **References**:
- **https**: //developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html
<a id="camel.toolkits.wechat_official_toolkit._make_wechat_request"></a>
diff --git a/docs/reference/camel.agents.chat_agent.md b/docs/reference/camel.agents.chat_agent.md
index 7c2210342..3fecd4dfe 100644
--- a/docs/reference/camel.agents.chat_agent.md
+++ b/docs/reference/camel.agents.chat_agent.md
@@ -1,5 +1,13 @@
<a id="camel.agents.chat_agent"></a>
+<a id="camel.agents.chat_agent._cleanup_temp_files"></a>
+
+## _cleanup_temp_files
+
+```python
+def _cleanup_temp_files():
+```
+
<a id="camel.agents.chat_agent.StreamContentAccumulator"></a>
## StreamContentAccumulator
@@ -39,6 +47,16 @@ def add_streaming_content(self, new_content: str):
Add new streaming content.
+<a id="camel.agents.chat_agent.StreamContentAccumulator.add_reasoning_content"></a>
+
+### add_reasoning_content
+
+```python
+def add_reasoning_content(self, new_reasoning: str):
+```
+
+Add new reasoning content.
+
<a id="camel.agents.chat_agent.StreamContentAccumulator.add_tool_status"></a>
### add_tool_status
@@ -59,6 +77,16 @@ def get_full_content(self):
Get the complete accumulated content.
+<a id="camel.agents.chat_agent.StreamContentAccumulator.get_full_reasoning_content"></a>
+
+### get_full_reasoning_content
+
+```python
+def get_full_reasoning_content(self):
+```
+
+Get the complete accumulated reasoning content.
+
<a id="camel.agents.chat_agent.StreamContentAccumulator.get_content_with_new_status"></a>
### get_content_with_new_status
@@ -229,9 +257,9 @@ Class for managing conversations of CAMEL Chat Agents.
- **system_message** (Union[BaseMessage, str], optional): The system message for the chat agent. (default: :obj:`None`) model (Union[BaseModelBackend, Tuple[str, str], str, ModelType, Tuple[ModelPlatformType, ModelType], List[BaseModelBackend], List[str], List[ModelType], List[Tuple[str, str]], List[Tuple[ModelPlatformType, ModelType]]], optional): The model backend(s) to use. Can be a single instance, a specification (string, enum, tuple), or a list of instances or specifications to be managed by `ModelManager`. If a list of specifications (not `BaseModelBackend` instances) is provided, they will be instantiated using `ModelFactory`. (default: :obj:`ModelPlatformType.DEFAULT` with `ModelType.DEFAULT`)
- **memory** (AgentMemory, optional): The agent memory for managing chat messages. If `None`, a :obj:`ChatHistoryMemory` will be used. (default: :obj:`None`)
- **message_window_size** (int, optional): The maximum number of previous messages to include in the context window. If `None`, no windowing is performed. (default: :obj:`None`)
-- **token_limit** (int, optional): The maximum number of tokens in a context. The context will be automatically pruned to fulfill the limitation. If `None`, it will be set according to the backend model. (default: :obj:`None`)
+- **summarize_threshold** (int, optional): The percentage of the context window that triggers summarization. If `None`, will trigger summarization when the context window is full. (default: :obj:`None`)
- **output_language** (str, optional): The language to be output by the agent. (default: :obj:`None`)
-- **tools** (Optional[List[Union[FunctionTool, Callable]]], optional): List of available :obj:`FunctionTool` or :obj:`Callable`. (default: :obj:`None`) external_tools (Optional[List[Union[FunctionTool, Callable, Dict[str, Any]]]], optional): List of external tools (:obj:`FunctionTool` or :obj:`Callable` or :obj:`Dict[str, Any]`) bind to one chat agent. When these tools are called, the agent will directly return the request instead of processing it. (default: :obj:`None`)
+- **tools** (Optional[List[Union[FunctionTool, Callable]]], optional): List of available :obj:`FunctionTool` or :obj:`Callable`. (default: :obj:`None`) toolkits_to_register_agent (Optional[List[RegisteredAgentToolkit]], optional): List of toolkit instances that inherit from :obj:`RegisteredAgentToolkit`. The agent will register itself with these toolkits, allowing them to access the agent instance. Note: This does NOT add the toolkit's tools to the agent. To use tools from these toolkits, pass them explicitly via the `tools` parameter. (default: :obj:`None`) external_tools (Optional[List[Union[FunctionTool, Callable, Dict[str, Any]]]], optional): List of external tools (:obj:`FunctionTool` or :obj:`Callable` or :obj:`Dict[str, Any]`) bind to one chat agent. When these tools are called, the agent will directly return the request instead of processing it. (default: :obj:`None`)
- **response_terminators** (List[ResponseTerminator], optional): List of :obj:`ResponseTerminator` bind to one chat agent. (default: :obj:`None`)
- **scheduling_strategy** (str): name of function that defines how to select the next model in ModelManager. (default: :str:`round_robin`)
- **max_iteration** (Optional[int], optional): Maximum number of model calling iterations allowed per step. If `None` (default), there's no explicit limit. If `1`, it performs a single model call. If `N > 1`, it allows up to N model calls. (default: :obj:`None`)
@@ -239,7 +267,14 @@ Class for managing conversations of CAMEL Chat Agents.
- **stop_event** (Optional[threading.Event], optional): Event to signal termination of the agent's operation. When set, the agent will terminate its execution. (default: :obj:`None`)
- **tool_execution_timeout** (Optional[float], optional): Timeout for individual tool execution. If None, wait indefinitely.
- **mask_tool_output** (Optional[bool]): Whether to return a sanitized placeholder instead of the raw tool output. (default: :obj:`False`)
-- **pause_event** (Optional[asyncio.Event]): Event to signal pause of the agent's operation. When clear, the agent will pause its execution. (default: :obj:`None`)
+- **pause_event** (Optional[Union[threading.Event, asyncio.Event]]): Event to signal pause of the agent's operation. When clear, the agent will pause its execution. Use threading.Event for sync operations or asyncio.Event for async operations. (default: :obj:`None`)
+- **prune_tool_calls_from_memory** (bool): Whether to clean tool call messages from memory after response generation to save token usage. When enabled, removes FUNCTION/TOOL role messages and ASSISTANT messages with tool_calls after each step. (default: :obj:`False`)
+- **enable_snapshot_clean** (bool, optional): Whether to clean snapshot markers and references from historical tool outputs in memory. This removes verbose DOM markers (like [ref=...]) from older tool results while keeping the latest output intact for immediate use. (default: :obj:`False`)
+- **retry_attempts** (int, optional): Maximum number of retry attempts for rate limit errors. (default: :obj:`3`)
+- **retry_delay** (float, optional): Initial delay in seconds between retries. Uses exponential backoff. (default: :obj:`1.0`)
+- **step_timeout** (Optional[float], optional): Timeout in seconds for the entire step operation. If None, no timeout is applied. (default: :obj:`None`)
+- **stream_accumulate** (bool, optional): When True, partial streaming updates return accumulated content (current behavior). When False, partial updates return only the incremental delta. (default: :obj:`True`)
+- **summary_window_ratio** (float, optional): Maximum fraction of the total context window that can be occupied by summary information. Used to limit how much of the model's context is reserved for summarization results. (default: :obj:`0.6`)
<a id="camel.agents.chat_agent.ChatAgent.__init__"></a>
@@ -252,18 +287,27 @@ def __init__(
model: Optional[Union[BaseModelBackend, ModelManager, Tuple[str, str], str, ModelType, Tuple[ModelPlatformType, ModelType], List[BaseModelBackend], List[str], List[ModelType], List[Tuple[str, str]], List[Tuple[ModelPlatformType, ModelType]]]] = None,
memory: Optional[AgentMemory] = None,
message_window_size: Optional[int] = None,
+ summarize_threshold: Optional[int] = 50,
token_limit: Optional[int] = None,
output_language: Optional[str] = None,
tools: Optional[List[Union[FunctionTool, Callable]]] = None,
+ toolkits_to_register_agent: Optional[List[RegisteredAgentToolkit]] = None,
external_tools: Optional[List[Union[FunctionTool, Callable, Dict[str, Any]]]] = None,
response_terminators: Optional[List[ResponseTerminator]] = None,
scheduling_strategy: str = 'round_robin',
max_iteration: Optional[int] = None,
agent_id: Optional[str] = None,
stop_event: Optional[threading.Event] = None,
- tool_execution_timeout: Optional[float] = None,
+ tool_execution_timeout: Optional[float] = Constants.TIMEOUT_THRESHOLD,
mask_tool_output: bool = False,
- pause_event: Optional[asyncio.Event] = None
+ pause_event: Optional[Union[threading.Event, asyncio.Event]] = None,
+ prune_tool_calls_from_memory: bool = False,
+ enable_snapshot_clean: bool = False,
+ retry_attempts: int = 3,
+ retry_delay: float = 1.0,
+ step_timeout: Optional[float] = Constants.TIMEOUT_THRESHOLD,
+ stream_accumulate: bool = True,
+ summary_window_ratio: float = 0.6
):
```
@@ -364,6 +408,50 @@ Set the output language for the agent.
Note that this will clear the message history.
+<a id="camel.agents.chat_agent.ChatAgent.memory"></a>
+
+### memory
+
+```python
+def memory(self):
+```
+
+Returns the agent memory.
+
+<a id="camel.agents.chat_agent.ChatAgent.memory"></a>
+
+### memory
+
+```python
+def memory(self, value: AgentMemory):
+```
+
+Set the agent memory.
+
+When setting a new memory, the system message is automatically
+re-added to ensure it's not lost.
+
+**Parameters:**
+
+- **value** (AgentMemory): The new agent memory to use.
+
+<a id="camel.agents.chat_agent.ChatAgent.set_context_utility"></a>
+
+### set_context_utility
+
+```python
+def set_context_utility(self, context_utility: Optional[ContextUtility]):
+```
+
+Set the context utility for the agent.
+
+This allows external components (like SingleAgentWorker) to provide
+a shared context utility instance for workflow management.
+
+**Parameters:**
+
+- **context_utility** (ContextUtility, optional): The context utility to use. If None, the agent will create its own when needed.
+
<a id="camel.agents.chat_agent.ChatAgent._get_full_tool_schemas"></a>
### _get_full_tool_schemas
@@ -375,6 +463,122 @@ def _get_full_tool_schemas(self):
Returns a list of tool schemas of all tools, including internal
and external tools.
+<a id="camel.agents.chat_agent.ChatAgent._is_token_limit_error"></a>
+
+### _is_token_limit_error
+
+```python
+def _is_token_limit_error(error: Exception):
+```
+
+Return True when the exception message indicates a token limit.
+
+<a id="camel.agents.chat_agent.ChatAgent._is_tool_related_record"></a>
+
+### _is_tool_related_record
+
+```python
+def _is_tool_related_record(record: MemoryRecord):
+```
+
+Determine whether the given memory record
+belongs to a tool call.
+
+<a id="camel.agents.chat_agent.ChatAgent._find_indices_to_remove_for_last_tool_pair"></a>
+
+### _find_indices_to_remove_for_last_tool_pair
+
+```python
+def _find_indices_to_remove_for_last_tool_pair(self, recent_records: List[ContextRecord]):
+```
+
+**Returns:**
+
+ List[int]: Indices to remove (may be non-contiguous).
+
+<a id="camel.agents.chat_agent.ChatAgent._serialize_tool_args"></a>
+
+### _serialize_tool_args
+
+```python
+def _serialize_tool_args(args: Dict[str, Any]):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._build_tool_signature"></a>
+
+### _build_tool_signature
+
+```python
+def _build_tool_signature(cls, func_name: str, args: Dict[str, Any]):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._describe_tool_call"></a>
+
+### _describe_tool_call
+
+```python
+def _describe_tool_call(self, record: Optional[ToolCallingRecord]):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._update_last_tool_call_state"></a>
+
+### _update_last_tool_call_state
+
+```python
+def _update_last_tool_call_state(self, record: Optional[ToolCallingRecord]):
+```
+
+Track the most recent tool call and its identifying signature.
+
+<a id="camel.agents.chat_agent.ChatAgent._format_tool_limit_notice"></a>
+
+### _format_tool_limit_notice
+
+```python
+def _format_tool_limit_notice(self):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._append_user_messages_section"></a>
+
+### _append_user_messages_section
+
+```python
+def _append_user_messages_section(summary_content: str, user_messages: List[str]):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._reset_summary_state"></a>
+
+### _reset_summary_state
+
+```python
+def _reset_summary_state(self):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._calculate_next_summary_threshold"></a>
+
+### _calculate_next_summary_threshold
+
+```python
+def _calculate_next_summary_threshold(self):
+```
+
+**Returns:**
+
+ int: The token count threshold for next summarization.
+
+<a id="camel.agents.chat_agent.ChatAgent._update_memory_with_summary"></a>
+
+### _update_memory_with_summary
+
+```python
+def _update_memory_with_summary(self, summary: str, include_summaries: bool = False):
+```
+
+Update memory with summary result.
+
+This method handles memory clearing and restoration of summaries based
+on whether it's a progressive or full compression.
+
<a id="camel.agents.chat_agent.ChatAgent._get_external_tool_names"></a>
### _get_external_tool_names
@@ -405,6 +609,124 @@ def add_tools(self, tools: List[Union[FunctionTool, Callable]]):
Add a list of tools to the agent.
+<a id="camel.agents.chat_agent.ChatAgent._serialize_tool_result"></a>
+
+### _serialize_tool_result
+
+```python
+def _serialize_tool_result(self, result: Any):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._clean_snapshot_line"></a>
+
+### _clean_snapshot_line
+
+```python
+def _clean_snapshot_line(self, line: str):
+```
+
+Clean a single snapshot line by removing prefixes and references.
+
+This method handles snapshot lines in the format:
+- [prefix] "quoted text" [attributes] [ref=...]: description
+
+It preserves:
+- Quoted text content (including brackets inside quotes)
+- Description text after the colon
+
+It removes:
+- Line prefixes (e.g., "- button", "- tooltip", "generic:")
+- Attribute markers (e.g., [disabled], [ref=e47])
+- Lines with only element types
+- All indentation
+
+**Parameters:**
+
+- **line**: The original line content.
+
+**Returns:**
+
+ The cleaned line content, or empty string if line should be
+removed.
+
+<a id="camel.agents.chat_agent.ChatAgent._clean_snapshot_content"></a>
+
+### _clean_snapshot_content
+
+```python
+def _clean_snapshot_content(self, content: str):
+```
+
+Clean snapshot content by removing prefixes, references, and
+deduplicating lines.
+
+This method identifies snapshot lines (containing element keywords or
+references) and cleans them while preserving non-snapshot content.
+It also handles JSON-formatted tool outputs with snapshot fields.
+
+**Parameters:**
+
+- **content**: The original snapshot content.
+
+**Returns:**
+
+ The cleaned content with deduplicated lines.
+
+<a id="camel.agents.chat_agent.ChatAgent._clean_text_snapshot"></a>
+
+### _clean_text_snapshot
+
+```python
+def _clean_text_snapshot(self, content: str):
+```
+
+Clean plain text snapshot content.
+
+This method:
+- Removes all indentation
+- Deletes empty lines
+- Deduplicates all lines
+- Cleans snapshot-specific markers
+
+**Parameters:**
+
+- **content**: The original snapshot text.
+
+**Returns:**
+
+ The cleaned content with deduplicated lines, no indentation,
+and no empty lines.
+
+<a id="camel.agents.chat_agent.ChatAgent._register_tool_output_for_cache"></a>
+
+### _register_tool_output_for_cache
+
+```python
+def _register_tool_output_for_cache(
+ self,
+ func_name: str,
+ tool_call_id: str,
+ result_text: str,
+ records: List[MemoryRecord]
+):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._process_tool_output_cache"></a>
+
+### _process_tool_output_cache
+
+```python
+def _process_tool_output_cache(self):
+```
+
+<a id="camel.agents.chat_agent.ChatAgent._clean_snapshot_in_memory"></a>
+
+### _clean_snapshot_in_memory
+
+```python
+def _clean_snapshot_in_memory(self, entry: _ToolOutputHistoryEntry):
+```
+
<a id="camel.agents.chat_agent.ChatAgent.add_external_tool"></a>
### add_external_tool
@@ -468,27 +790,24 @@ def update_memory(
self,
message: BaseMessage,
role: OpenAIBackendRole,
- timestamp: Optional[float] = None
+ timestamp: Optional[float] = None,
+ return_records: bool = False
):
```
Updates the agent memory with a new message.
-If the single *message* exceeds the model's context window, it will
-be **automatically split into multiple smaller chunks** before being
-written into memory. This prevents later failures in
-`ScoreBasedContextCreator` where an over-sized message cannot fit
-into the available token budget at all.
-
-This slicing logic handles both regular text messages (in the
-`content` field) and long tool call results (in the `result` field of
-a `FunctionCallingMessage`).
-
**Parameters:**
- **message** (BaseMessage): The new message to add to the stored messages.
- **role** (OpenAIBackendRole): The backend role type.
-- **timestamp** (Optional[float], optional): Custom timestamp for the memory record. If `None`, the current time will be used. (default: :obj:`None`) (default: obj:`None`)
+- **timestamp** (Optional[float], optional): Custom timestamp for the memory record. If `None`, the current time will be used. (default: :obj:`None`)
+- **return_records** (bool, optional): When `__INLINE_CODE_0____INLINE_CODE_1__False`)
+
+**Returns:**
+
+ Optional[List[MemoryRecord]]: The records that were written when
+`__INLINE_CODE_0____INLINE_CODE_1____INLINE_CODE_2____INLINE_CODE_3____INLINE_CODE_4__`.
<a id="camel.agents.chat_agent.ChatAgent.load_memory"></a>
@@ -537,6 +856,72 @@ into a JSON file using JsonStorage.
- **path** (str): Target file path to store JSON data.
+<a id="camel.agents.chat_agent.ChatAgent.summarize"></a>
+
+### summarize
+
+```python
+def summarize(
+ self,
+ filename: Optional[str] = None,
+ summary_prompt: Optional[str] = None,
+ response_format: Optional[Type[BaseModel]] = None,
+ working_directory: Optional[Union[str, Path]] = None,
+ include_summaries: bool = False,
+ add_user_messages: bool = True
+):
+```
+
+Summarize the agent's current conversation context and persist it
+to a markdown file.
+
+.. deprecated:: 0.2.80
+Use :meth:`asummarize` for async/await support and better
+performance in parallel summarization workflows.
+
+**Parameters:**
+
+- **filename** (Optional[str]): The base filename (without extension) to use for the markdown file. Defaults to a timestamped name when not provided.
+- **summary_prompt** (Optional[str]): Custom prompt for the summarizer. When omitted, a default prompt highlighting key decisions, action items, and open questions is used.
+- **response_format** (Optional[Type[BaseModel]]): A Pydantic model defining the expected structure of the response. If provided, the summary will be generated as structured output and included in the result.
+- **include_summaries** (bool): Whether to include previously generated summaries in the content to be summarized. If False (default), only non-summary messages will be summarized. If True, all messages including previous summaries will be summarized (full compression). (default: :obj:`False`)
+- **working_directory** (Optional[str|Path]): Optional directory to save the markdown summary file. If provided, overrides the default directory used by ContextUtility.
+- **add_user_messages** (bool): Whether add user messages to summary. (default: :obj:`True`)
+
+**Returns:**
+
+ Dict[str, Any]: A dictionary containing the summary text, file
+path, status message, and optionally structured_summary if
+response_format was provided.
+
+See Also:
+:meth:`asummarize`: Async version for non-blocking LLM calls.
+
+<a id="camel.agents.chat_agent.ChatAgent._build_conversation_text_from_messages"></a>
+
+### _build_conversation_text_from_messages
+
+```python
+def _build_conversation_text_from_messages(self, messages: List[Any], include_summaries: bool = False):
+```
+
+Build conversation text from messages for summarization.
+
+This is a shared helper method that converts messages to a formatted
+conversation text string, handling tool calls, tool results, and
+regular messages.
+
+**Parameters:**
+
+- **messages** (List[Any]): List of messages to convert.
+- **include_summaries** (bool): Whether to include messages starting with [CONTEXT_SUMMARY]. (default: :obj:`False`)
+
+**Returns:**
+
+ tuple[str, List[str]]: A tuple containing:
+- Formatted conversation text
+- List of user messages extracted from the conversation
+
<a id="camel.agents.chat_agent.ChatAgent.clear_memory"></a>
### clear_memory
@@ -572,6 +957,56 @@ def init_messages(self):
Initializes the stored messages list with the current system
message.
+<a id="camel.agents.chat_agent.ChatAgent.update_system_message"></a>
+
+### update_system_message
+
+```python
+def update_system_message(
+ self,
+ system_message: Union[BaseMessage, str],
+ reset_memory: bool = True
+):
+```
+
+Update the system message.
+It will reset conversation with new system message.
+
+**Parameters:**
+
+- **system_message** (Union[BaseMessage, str]): The new system message. Can be either a BaseMessage object or a string. If a string is provided, it will be converted into a BaseMessage object.
+- **reset_memory** (bool): Whether to reinitialize conversation messages after updating the system message. Defaults to True.
+
+<a id="camel.agents.chat_agent.ChatAgent.append_to_system_message"></a>
+
+### append_to_system_message
+
+```python
+def append_to_system_message(self, content: str, reset_memory: bool = True):
+```
+
+Append additional context to existing system message.
+
+**Parameters:**
+
+- **content** (str): The additional system message.
+- **reset_memory** (bool): Whether to reinitialize conversation messages after appending additional context. Defaults to True.
+
+<a id="camel.agents.chat_agent.ChatAgent.reset_to_original_system_message"></a>
+
+### reset_to_original_system_message
+
+```python
+def reset_to_original_system_message(self):
+```
+
+Reset system message to original, removing any appended context.
+
+This method reverts the agent's system message back to its original
+state, removing any workflow context or other modifications that may
+have been appended. Useful for resetting agent state in multi-turn
+scenarios.
+
<a id="camel.agents.chat_agent.ChatAgent.record_message"></a>
### record_message
@@ -656,6 +1091,18 @@ Handle response format when tools are not strict mode compatible.
Tuple: (modified_message, modified_response_format,
used_prompt_formatting)
+<a id="camel.agents.chat_agent.ChatAgent._is_called_from_registered_toolkit"></a>
+
+### _is_called_from_registered_toolkit
+
+```python
+def _is_called_from_registered_toolkit(self):
+```
+
+**Returns:**
+
+ bool: True if called from a RegisteredAgentToolkit, False otherwise
+
<a id="camel.agents.chat_agent.ChatAgent._apply_prompt_based_parsing"></a>
### _apply_prompt_based_parsing
@@ -721,6 +1168,20 @@ a StreamingChatAgentResponse that behaves like
ChatAgentResponse but can also be iterated for
streaming updates.
+<a id="camel.agents.chat_agent.ChatAgent._step_impl"></a>
+
+### _step_impl
+
+```python
+def _step_impl(
+ self,
+ input_message: Union[BaseMessage, str],
+ response_format: Optional[Type[BaseModel]] = None
+):
+```
+
+Implementation of non-streaming step logic.
+
<a id="camel.agents.chat_agent.ChatAgent.chat_history"></a>
### chat_history
@@ -775,18 +1236,6 @@ def _convert_to_chatagent_response(
Parse the final model response into the chat agent response.
-<a id="camel.agents.chat_agent.ChatAgent._process_pending_images"></a>
-
-### _process_pending_images
-
-```python
-def _process_pending_images(self):
-```
-
-**Returns:**
-
- List: List of successfully converted PIL Images.
-
<a id="camel.agents.chat_agent.ChatAgent._record_final_output"></a>
### _record_final_output
@@ -797,37 +1246,6 @@ def _record_final_output(self, output_messages: List[BaseMessage]):
Log final messages or warnings about multiple responses.
-<a id="camel.agents.chat_agent.ChatAgent._is_vision_error"></a>
-
-### _is_vision_error
-
-```python
-def _is_vision_error(self, exc: Exception):
-```
-
-Check if the exception is likely related to vision/image is not
-supported by the model.
-
-<a id="camel.agents.chat_agent.ChatAgent._has_images"></a>
-
-### _has_images
-
-```python
-def _has_images(self, messages: List[OpenAIMessage]):
-```
-
-Check if any message contains images.
-
-<a id="camel.agents.chat_agent.ChatAgent._strip_images_from_messages"></a>
-
-### _strip_images_from_messages
-
-```python
-def _strip_images_from_messages(self, messages: List[OpenAIMessage]):
-```
-
-Remove images from messages, keeping only text content.
-
<a id="camel.agents.chat_agent.ChatAgent._get_model_response"></a>
### _get_model_response
@@ -837,8 +1255,10 @@ def _get_model_response(
self,
openai_messages: List[OpenAIMessage],
num_tokens: int,
+ current_iteration: int = 0,
response_format: Optional[Type[BaseModel]] = None,
- tool_schemas: Optional[List[Dict[str, Any]]] = None
+ tool_schemas: Optional[List[Dict[str, Any]]] = None,
+ prev_num_openai_messages: int = 0
):
```
@@ -849,7 +1269,7 @@ Internal function for agent step model response.
### _sanitize_messages_for_logging
```python
-def _sanitize_messages_for_logging(self, messages):
+def _sanitize_messages_for_logging(self, messages, prev_num_openai_messages: int):
```
Sanitize OpenAI messages for logging by replacing base64 image
@@ -858,6 +1278,7 @@ data with a simple message and a link to view the image.
**Parameters:**
- **messages** (List[OpenAIMessage]): The OpenAI messages to sanitize.
+- **prev_num_openai_messages** (int): The number of openai messages logged in the previous iteration.
**Returns:**
@@ -991,7 +1412,8 @@ def _record_tool_calling(
args: Dict[str, Any],
result: Any,
tool_call_id: str,
- mask_output: bool = False
+ mask_output: bool = False,
+ extra_content: Optional[Dict[str, Any]] = None
):
```
@@ -1005,6 +1427,7 @@ tool calling record.
- **result** (Any): The result returned by the tool execution.
- **tool_call_id** (str): A unique identifier for the tool call.
- **mask_output** (bool, optional): Whether to return a sanitized placeholder instead of the raw tool output. (default: :obj:`False`)
+- **extra_content** (Optional[Dict[str, Any]], optional): Additional content associated with the tool call. (default: :obj:`None`)
**Returns:**
@@ -1108,15 +1531,12 @@ any tool call is complete.
def _execute_tools_sync_with_status_accumulator(
self,
accumulated_tool_calls: Dict[str, Any],
- content_accumulator: StreamContentAccumulator,
- step_token_usage: Dict[str, int],
tool_call_records: List[ToolCallingRecord]
):
```
-Execute multiple tools synchronously with
-proper content accumulation, using threads+queue for
-non-blocking status streaming.
+Execute multiple tools synchronously with proper content
+accumulation, using ThreadPoolExecutor for better timeout handling.
<a id="camel.agents.chat_agent.ChatAgent._execute_tool_from_stream_data"></a>
@@ -1155,23 +1575,6 @@ Record the assistant message that contains tool calls.
This method creates and records an assistant message that includes
the tool calls information, which is required by OpenAI's API format.
-<a id="camel.agents.chat_agent.ChatAgent._create_tool_status_response_with_accumulator"></a>
-
-### _create_tool_status_response_with_accumulator
-
-```python
-def _create_tool_status_response_with_accumulator(
- self,
- accumulator: StreamContentAccumulator,
- status_message: str,
- status_type: str,
- step_token_usage: Dict[str, int],
- tool_calls: Optional[List[ToolCallingRecord]] = None
-):
-```
-
-Create a tool status response using content accumulator.
-
<a id="camel.agents.chat_agent.ChatAgent._create_streaming_response_with_accumulator"></a>
### _create_streaming_response_with_accumulator
@@ -1183,7 +1586,8 @@ def _create_streaming_response_with_accumulator(
new_content: str,
step_token_usage: Dict[str, int],
response_id: str = '',
- tool_call_records: Optional[List[ToolCallingRecord]] = None
+ tool_call_records: Optional[List[ToolCallingRecord]] = None,
+ reasoning_delta: Optional[str] = None
):
```
@@ -1251,8 +1655,11 @@ configuration.
def _clone_tools(self):
```
-Clone tools for new agent instance,
-handling stateful toolkits properly.
+**Returns:**
+
+ Tuple containing:
+- List of cloned tools/functions
+- List of RegisteredAgentToolkit instances need registration
<a id="camel.agents.chat_agent.ChatAgent.__repr__"></a>
diff --git a/docs/reference/camel.loaders.firecrawl_reader.md b/docs/reference/camel.loaders.firecrawl_reader.md
new file mode 100644
index 000000000..5a0d0c047
--- /dev/null
+++ b/docs/reference/camel.loaders.firecrawl_reader.md
@@ -0,0 +1,136 @@
+<a id="camel.loaders.firecrawl_reader"></a>
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl"></a>
+
+## Firecrawl
+
+```python
+class Firecrawl:
+```
+
+Firecrawl allows you to turn entire websites into LLM-ready markdown.
+
+**Parameters:**
+
+- **api_key** (Optional[str]): API key for authenticating with the Firecrawl API.
+- **api_url** (Optional[str]): Base URL for the Firecrawl API.
+- **References**:
+- **https**: //docs.firecrawl.dev/introduction
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ api_key: Optional[str] = None,
+ api_url: Optional[str] = None
+):
+```
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.crawl"></a>
+
+### crawl
+
+```python
+def crawl(
+ self,
+ url: str,
+ params: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+):
+```
+
+Crawl a URL and all accessible subpages. Customize the crawl by
+setting different parameters, and receive the full response or a job
+ID based on the specified options.
+
+**Parameters:**
+
+- **url** (str): The URL to crawl.
+- **params** (Optional[Dict[str, Any]]): Additional parameters for the crawl request. Defaults to `None`. **kwargs (Any): Additional keyword arguments, such as `poll_interval`, `idempotency_key`.
+
+**Returns:**
+
+ Any: The crawl job ID or the crawl results if waiting until
+completion.
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.check_crawl_job"></a>
+
+### check_crawl_job
+
+```python
+def check_crawl_job(self, job_id: str):
+```
+
+Check the status of a crawl job.
+
+**Parameters:**
+
+- **job_id** (str): The ID of the crawl job.
+
+**Returns:**
+
+ Dict: The response including status of the crawl job.
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.scrape"></a>
+
+### scrape
+
+```python
+def scrape(self, url: str, params: Optional[Dict[str, str]] = None):
+```
+
+To scrape a single URL. This function supports advanced scraping
+by setting different parameters and returns the full scraped data as a
+dictionary.
+
+Reference: https://docs.firecrawl.dev/advanced-scraping-guide
+
+**Parameters:**
+
+- **url** (str): The URL to read.
+- **params** (Optional[Dict[str, str]]): Additional parameters for the scrape request.
+
+**Returns:**
+
+ Dict[str, str]: The scraped data.
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.structured_scrape"></a>
+
+### structured_scrape
+
+```python
+def structured_scrape(self, url: str, response_format: BaseModel):
+```
+
+Use LLM to extract structured data from given URL.
+
+**Parameters:**
+
+- **url** (str): The URL to read.
+- **response_format** (BaseModel): A pydantic model that includes value types and field descriptions used to generate a structured response by LLM. This schema helps in defining the expected output format.
+
+**Returns:**
+
+ Dict: The content of the URL.
+
+<a id="camel.loaders.firecrawl_reader.Firecrawl.map_site"></a>
+
+### map_site
+
+```python
+def map_site(self, url: str, params: Optional[Dict[str, Any]] = None):
+```
+
+Map a website to retrieve all accessible URLs.
+
+**Parameters:**
+
+- **url** (str): The URL of the site to map.
+- **params** (Optional[Dict[str, Any]]): Additional parameters for the map request. Defaults to `None`.
+
+**Returns:**
+
+ list: A list containing the URLs found on the site.
diff --git a/docs/reference/camel.loaders.jina_url_reader.md b/docs/reference/camel.loaders.jina_url_reader.md
new file mode 100644
index 000000000..4a726e233
--- /dev/null
+++ b/docs/reference/camel.loaders.jina_url_reader.md
@@ -0,0 +1,56 @@
+<a id="camel.loaders.jina_url_reader"></a>
+
+<a id="camel.loaders.jina_url_reader.JinaURLReader"></a>
+
+## JinaURLReader
+
+```python
+class JinaURLReader:
+```
+
+URL Reader provided by Jina AI. The output is cleaner and more
+LLM-friendly than the URL Reader of UnstructuredIO. Can be configured to
+replace the UnstructuredIO URL Reader in the pipeline.
+
+**Parameters:**
+
+- **api_key** (Optional[str], optional): The API key for Jina AI. If not provided, the reader will have a lower rate limit. Defaults to None.
+- **return_format** (ReturnFormat, optional): The level of detail of the returned content, which is optimized for LLMs. For now screenshots are not supported. Defaults to ReturnFormat.DEFAULT.
+- **json_response** (bool, optional): Whether to return the response in JSON format. Defaults to False.
+- **timeout** (int, optional): The maximum time in seconds to wait for the page to be rendered. Defaults to 30. **kwargs (Any): Additional keyword arguments, including proxies, cookies, etc. It should align with the HTTP Header field and value pairs listed in the reference.
+- **References**:
+- **https**: //jina.ai/reader
+
+<a id="camel.loaders.jina_url_reader.JinaURLReader.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ api_key: Optional[str] = None,
+ return_format: JinaReturnFormat = JinaReturnFormat.DEFAULT,
+ json_response: bool = False,
+ timeout: int = 30,
+ **kwargs: Any
+):
+```
+
+<a id="camel.loaders.jina_url_reader.JinaURLReader.read_content"></a>
+
+### read_content
+
+```python
+def read_content(self, url: str):
+```
+
+Reads the content of a URL and returns it as a string with
+given form.
+
+**Parameters:**
+
+- **url** (str): The URL to read.
+
+**Returns:**
+
+ str: The content of the URL.
diff --git a/docs/reference/camel.loaders.scrapegraph_reader.md b/docs/reference/camel.loaders.scrapegraph_reader.md
new file mode 100644
index 000000000..39bbb7ce2
--- /dev/null
+++ b/docs/reference/camel.loaders.scrapegraph_reader.md
@@ -0,0 +1,80 @@
+<a id="camel.loaders.scrapegraph_reader"></a>
+
+<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI"></a>
+
+## ScrapeGraphAI
+
+```python
+class ScrapeGraphAI:
+```
+
+ScrapeGraphAI allows you to perform AI-powered web scraping and
+searching.
+
+**Parameters:**
+
+- **api_key** (Optional[str]): API key for authenticating with the ScrapeGraphAI API.
+- **References**:
+- **https**: //scrapegraph.ai/
+
+<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.__init__"></a>
+
+### __init__
+
+```python
+def __init__(self, api_key: Optional[str] = None):
+```
+
+<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.search"></a>
+
+### search
+
+```python
+def search(self, user_prompt: str):
+```
+
+Perform an AI-powered web search using ScrapeGraphAI.
+
+**Parameters:**
+
+- **user_prompt** (str): The search query or instructions.
+
+**Returns:**
+
+ Dict[str, Any]: The search results including answer and reference
+URLs.
+
+<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.scrape"></a>
+
+### scrape
+
+```python
+def scrape(
+ self,
+ website_url: str,
+ user_prompt: str,
+ website_html: Optional[str] = None
+):
+```
+
+Perform AI-powered web scraping using ScrapeGraphAI.
+
+**Parameters:**
+
+- **website_url** (str): The URL to scrape.
+- **user_prompt** (str): Instructions for what data to extract.
+- **website_html** (Optional[str]): Optional HTML content to use instead of fetching from the URL.
+
+**Returns:**
+
+ Dict[str, Any]: The scraped data including request ID and result.
+
+<a id="camel.loaders.scrapegraph_reader.ScrapeGraphAI.close"></a>
+
+### close
+
+```python
+def close(self):
+```
+
+Close the ScrapeGraphAI client connection.
diff --git a/docs/reference/camel.models.aws_bedrock_model.md b/docs/reference/camel.models.aws_bedrock_model.md
new file mode 100644
index 000000000..c03b3e431
--- /dev/null
+++ b/docs/reference/camel.models.aws_bedrock_model.md
@@ -0,0 +1,42 @@
+<a id="camel.models.aws_bedrock_model"></a>
+
+<a id="camel.models.aws_bedrock_model.AWSBedrockModel"></a>
+
+## AWSBedrockModel
+
+```python
+class AWSBedrockModel(OpenAICompatibleModel):
+```
+
+AWS Bedrock API in a unified OpenAICompatibleModel interface.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created.
+- **model_config_dict** (Dict[str, Any], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`.
+- **If**: obj:`None`, :obj:`BedrockConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (str, optional): The API key for authenticating with the AWS Bedrock service. (default: :obj:`None`)
+- **url** (str, optional): The url to the AWS Bedrock service.
+- **token_counter** (BaseTokenCounter, optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **References**:
+- **https**: //docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html
+
+<a id="camel.models.aws_bedrock_model.AWSBedrockModel.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any
+):
+```
diff --git a/docs/reference/camel.models.azure_openai_model.md b/docs/reference/camel.models.azure_openai_model.md
index 73f497cab..33c48bc45 100644
--- a/docs/reference/camel.models.azure_openai_model.md
+++ b/docs/reference/camel.models.azure_openai_model.md
@@ -12,17 +12,19 @@ Azure OpenAI API in a unified BaseModelBackend interface.
**Parameters:**
-- **model_type** (Union[ModelType, str]): Model for which a backend is created, one of GPT_* series.
+- **model_type** (Union[ModelType, str]): Model for which a backend is created, Should be the deployment name you chose when you deployed an azure model.
- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`. If :obj:`None`, :obj:`ChatGPTConfig().as_dict()` will be used. (default: :obj:`None`)
- **api_key** (Optional[str], optional): The API key for authenticating with the OpenAI service. (default: :obj:`None`)
- **url** (Optional[str], optional): The url to the OpenAI service. (default: :obj:`None`)
- **api_version** (Optional[str], optional): The api version for the model. (default: :obj:`None`)
-- **azure_deployment_name** (Optional[str], optional): The deployment name you chose when you deployed an azure model. (default: :obj:`None`)
- **azure_ad_token** (Optional[str], optional): Your Azure Active Directory token, https://www.microsoft.com/en-us/security/business/ identity-access/microsoft-entra-id. (default: :obj:`None`)
- **azure_ad_token_provider** (Optional[AzureADTokenProvider], optional): A function that returns an Azure Active Directory token, will be invoked on every request. (default: :obj:`None`)
- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter` will be used. (default: :obj:`None`)
- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
-- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`)
+- **client** (Optional[Any], optional): A custom synchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. Useful for RL frameworks like AReaL or rLLM that provide Azure OpenAI-compatible clients. The client should implement the AzureOpenAI client interface with `.chat.completions.create()` and `.beta.chat.completions.parse()` methods. (default: :obj:`None`)
+- **async_client** (Optional[Any], optional): A custom asynchronous AzureOpenAI client instance. If provided, this client will be used instead of creating a new one. The client should implement the AsyncAzureOpenAI client interface. (default: :obj:`None`)
+- **azure_deployment_name** (Optional[str], optional): **Deprecated**. Use `model_type` parameter instead. This parameter is kept for backward compatibility and will be removed in a future version. (default: :obj:`None`) **kwargs (Any): Additional arguments to pass to the client initialization. Ignored if custom clients are provided.
- **References**:
- **https**: //learn.microsoft.com/en-us/azure/ai-services/openai/
@@ -40,10 +42,12 @@ def __init__(
timeout: Optional[float] = None,
token_counter: Optional[BaseTokenCounter] = None,
api_version: Optional[str] = None,
- azure_deployment_name: Optional[str] = None,
azure_ad_token_provider: Optional['AzureADTokenProvider'] = None,
azure_ad_token: Optional[str] = None,
max_retries: int = 3,
+ client: Optional[Any] = None,
+ async_client: Optional[Any] = None,
+ azure_deployment_name: Optional[str] = None,
**kwargs: Any
):
```
diff --git a/docs/reference/camel.models.deepseek_model.md b/docs/reference/camel.models.deepseek_model.md
new file mode 100644
index 000000000..3ddde463d
--- /dev/null
+++ b/docs/reference/camel.models.deepseek_model.md
@@ -0,0 +1,79 @@
+<a id="camel.models.deepseek_model"></a>
+
+<a id="camel.models.deepseek_model.DeepSeekModel"></a>
+
+## DeepSeekModel
+
+```python
+class DeepSeekModel(OpenAICompatibleModel):
+```
+
+DeepSeek API in a unified OpenAICompatibleModel interface.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created.
+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`. If :obj:`None`, :obj:`DeepSeekConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (Optional[str], optional): The API key for authenticating with the DeepSeek service. (default: :obj:`None`)
+- **url** (Optional[str], optional): The url to the DeepSeek service. (default: :obj:`https://api.deepseek.com`)
+- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter` will be used. (default: :obj:`None`)
+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **References**:
+- **https**: //api-docs.deepseek.com/
+
+<a id="camel.models.deepseek_model.DeepSeekModel.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any
+):
+```
+
+<a id="camel.models.deepseek_model.DeepSeekModel._prepare_request"></a>
+
+### _prepare_request
+
+```python
+def _prepare_request(
+ self,
+ messages: List[OpenAIMessage],
+ response_format: Optional[Type[BaseModel]] = None,
+ tools: Optional[List[Dict[str, Any]]] = None
+):
+```
+
+<a id="camel.models.deepseek_model.DeepSeekModel._run"></a>
+
+### _run
+
+```python
+def _run(
+ self,
+ messages: List[OpenAIMessage],
+ response_format: Optional[Type[BaseModel]] = None,
+ tools: Optional[List[Dict[str, Any]]] = None
+):
+```
+
+Runs inference of DeepSeek chat completion.
+
+**Parameters:**
+
+- **messages** (List[OpenAIMessage]): Message list with the chat history in OpenAI API format.
+
+**Returns:**
+
+ Union[ChatCompletion, Stream[ChatCompletionChunk]]:
+`ChatCompletion` in the non-stream mode, or
+`Stream[ChatCompletionChunk]` in the stream mode.
diff --git a/docs/reference/camel.models.ollama_model.md b/docs/reference/camel.models.ollama_model.md
new file mode 100644
index 000000000..120869374
--- /dev/null
+++ b/docs/reference/camel.models.ollama_model.md
@@ -0,0 +1,52 @@
+<a id="camel.models.ollama_model"></a>
+
+<a id="camel.models.ollama_model.OllamaModel"></a>
+
+## OllamaModel
+
+```python
+class OllamaModel(OpenAICompatibleModel):
+```
+
+Ollama service interface.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created.
+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`.
+- **If**: obj:`None`, :obj:`OllamaConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (Optional[str], optional): The API key for authenticating with the model service. Required for Ollama cloud services. If not provided, defaults to "Not_Provided". (default: :obj:`None`)
+- **url** (Optional[str], optional): The url to the model service. (default: :obj:`None`)
+- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **References**:
+- **https**: //github.com/ollama/ollama/blob/main/docs/openai.md
+
+<a id="camel.models.ollama_model.OllamaModel.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any
+):
+```
+
+<a id="camel.models.ollama_model.OllamaModel._start_server"></a>
+
+### _start_server
+
+```python
+def _start_server(self):
+```
+
+Starts the Ollama server in a subprocess.
diff --git a/docs/reference/camel.models.vllm_model.md b/docs/reference/camel.models.vllm_model.md
new file mode 100644
index 000000000..e094621b1
--- /dev/null
+++ b/docs/reference/camel.models.vllm_model.md
@@ -0,0 +1,51 @@
+<a id="camel.models.vllm_model"></a>
+
+<a id="camel.models.vllm_model.VLLMModel"></a>
+
+## VLLMModel
+
+```python
+class VLLMModel(OpenAICompatibleModel):
+```
+
+vLLM service interface.
+
+**Parameters:**
+
+- **model_type** (Union[ModelType, str]): Model for which a backend is created.
+- **model_config_dict** (Optional[Dict[str, Any]], optional): A dictionary that will be fed into:obj:`openai.ChatCompletion.create()`. If :obj:`None`, :obj:`VLLMConfig().as_dict()` will be used. (default: :obj:`None`)
+- **api_key** (Optional[str], optional): The API key for authenticating with the model service. vLLM doesn't need API key, it would be ignored if set. (default: :obj:`None`)
+- **url** (Optional[str], optional): The url to the model service. If not provided, :obj:`"http://localhost:8000/v1"` will be used. (default: :obj:`None`)
+- **token_counter** (Optional[BaseTokenCounter], optional): Token counter to use for the model. If not provided, :obj:`OpenAITokenCounter( ModelType.GPT_4O_MINI)` will be used. (default: :obj:`None`)
+- **timeout** (Optional[float], optional): The timeout value in seconds for API calls. If not provided, will fall back to the MODEL_TIMEOUT environment variable or default to 180 seconds. (default: :obj:`None`)
+- **max_retries** (int, optional): Maximum number of retries for API calls. (default: :obj:`3`) **kwargs (Any): Additional arguments to pass to the client initialization.
+- **References**:
+- **https**: //docs.vllm.ai/en/latest/serving/openai_compatible_server.html
+
+<a id="camel.models.vllm_model.VLLMModel.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_type: Union[ModelType, str],
+ model_config_dict: Optional[Dict[str, Any]] = None,
+ api_key: Optional[str] = None,
+ url: Optional[str] = None,
+ token_counter: Optional[BaseTokenCounter] = None,
+ timeout: Optional[float] = None,
+ max_retries: int = 3,
+ **kwargs: Any
+):
+```
+
+<a id="camel.models.vllm_model.VLLMModel._start_server"></a>
+
+### _start_server
+
+```python
+def _start_server(self):
+```
+
+Starts the vllm server in a subprocess.
diff --git a/docs/reference/camel.retrievers.bm25_retriever.md b/docs/reference/camel.retrievers.bm25_retriever.md
new file mode 100644
index 000000000..e0d782cd4
--- /dev/null
+++ b/docs/reference/camel.retrievers.bm25_retriever.md
@@ -0,0 +1,74 @@
+<a id="camel.retrievers.bm25_retriever"></a>
+
+<a id="camel.retrievers.bm25_retriever.BM25Retriever"></a>
+
+## BM25Retriever
+
+```python
+class BM25Retriever(BaseRetriever):
+```
+
+An implementation of the `BaseRetriever` using the `BM25` model.
+
+This class facilitates the retriever of relevant information using a
+query-based approach, it ranks documents based on the occurrence and
+frequency of the query terms.
+
+**Parameters:**
+
+- **bm25** (BM25Okapi): An instance of the BM25Okapi class used for calculating document scores.
+- **content_input_path** (str): The path to the content that has been processed and stored.
+- **unstructured_modules** (UnstructuredIO): A module for parsing files and URLs and chunking content based on specified parameters.
+- **References**:
+- **https**: //github.com/dorianbrown/rank_bm25
+
+<a id="camel.retrievers.bm25_retriever.BM25Retriever.__init__"></a>
+
+### __init__
+
+```python
+def __init__(self):
+```
+
+Initializes the BM25Retriever.
+
+<a id="camel.retrievers.bm25_retriever.BM25Retriever.process"></a>
+
+### process
+
+```python
+def process(
+ self,
+ content_input_path: str,
+ chunk_type: str = 'chunk_by_title',
+ **kwargs: Any
+):
+```
+
+Processes content from a file or URL, divides it into chunks by
+using `Unstructured IO`,then stored internally. This method must be
+called before executing queries with the retriever.
+
+**Parameters:**
+
+- **content_input_path** (str): File path or URL of the content to be processed.
+- **chunk_type** (str): Type of chunking going to apply. Defaults to "chunk_by_title". **kwargs (Any): Additional keyword arguments for content parsing.
+
+<a id="camel.retrievers.bm25_retriever.BM25Retriever.query"></a>
+
+### query
+
+```python
+def query(self, query: str, top_k: int = DEFAULT_TOP_K_RESULTS):
+```
+
+Executes a query and compiles the results.
+
+**Parameters:**
+
+- **query** (str): Query string for information retriever.
+- **top_k** (int, optional): The number of top results to return during retriever. Must be a positive integer. Defaults to `DEFAULT_TOP_K_RESULTS`.
+
+**Returns:**
+
+ List[Dict[str]]: Concatenated list of the query results.
diff --git a/docs/reference/camel.retrievers.cohere_rerank_retriever.md b/docs/reference/camel.retrievers.cohere_rerank_retriever.md
new file mode 100644
index 000000000..f04ee8cd1
--- /dev/null
+++ b/docs/reference/camel.retrievers.cohere_rerank_retriever.md
@@ -0,0 +1,67 @@
+<a id="camel.retrievers.cohere_rerank_retriever"></a>
+
+<a id="camel.retrievers.cohere_rerank_retriever.CohereRerankRetriever"></a>
+
+## CohereRerankRetriever
+
+```python
+class CohereRerankRetriever(BaseRetriever):
+```
+
+An implementation of the `BaseRetriever` using the `Cohere Re-ranking`
+model.
+
+**Parameters:**
+
+- **model_name** (str): The model name to use for re-ranking.
+- **api_key** (Optional[str]): The API key for authenticating with the Cohere service.
+- **References**:
+- **https**: //txt.cohere.com/rerank/
+
+<a id="camel.retrievers.cohere_rerank_retriever.CohereRerankRetriever.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ model_name: str = 'rerank-multilingual-v2.0',
+ api_key: Optional[str] = None
+):
+```
+
+Initializes an instance of the CohereRerankRetriever. This
+constructor sets up a client for interacting with the Cohere API using
+the specified model name and API key. If the API key is not provided,
+it attempts to retrieve it from the COHERE_API_KEY environment
+variable.
+
+**Parameters:**
+
+- **model_name** (str): The name of the model to be used for re-ranking. Defaults to 'rerank-multilingual-v2.0'.
+- **api_key** (Optional[str]): The API key for authenticating requests to the Cohere API. If not provided, the method will attempt to retrieve the key from the environment variable 'COHERE_API_KEY'.
+
+<a id="camel.retrievers.cohere_rerank_retriever.CohereRerankRetriever.query"></a>
+
+### query
+
+```python
+def query(
+ self,
+ query: str,
+ retrieved_result: List[Dict[str, Any]],
+ top_k: int = DEFAULT_TOP_K_RESULTS
+):
+```
+
+Queries and compiles results using the Cohere re-ranking model.
+
+**Parameters:**
+
+- **query** (str): Query string for information retriever.
+- **retrieved_result** (List[Dict[str, Any]]): The content to be re-ranked, should be the output from `BaseRetriever` like `VectorRetriever`.
+- **top_k** (int, optional): The number of top results to return during retriever. Must be a positive integer. Defaults to `DEFAULT_TOP_K_RESULTS`.
+
+**Returns:**
+
+ List[Dict[str, Any]]: Concatenated list of the query results.
diff --git a/docs/reference/camel.storages.key_value_storages.mem0_cloud.md b/docs/reference/camel.storages.key_value_storages.mem0_cloud.md
new file mode 100644
index 000000000..f0a6d7043
--- /dev/null
+++ b/docs/reference/camel.storages.key_value_storages.mem0_cloud.md
@@ -0,0 +1,126 @@
+<a id="camel.storages.key_value_storages.mem0_cloud"></a>
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage"></a>
+
+## Mem0Storage
+
+```python
+class Mem0Storage(BaseKeyValueStorage):
+```
+
+A concrete implementation of the :obj:`BaseKeyValueStorage` using Mem0
+as the backend. This storage system uses Mem0's text capabilities to store,
+search, and manage text with context.
+
+**Parameters:**
+
+- **agent_id** (str): Default agent ID to associate memories with.
+- **api_key** (str, optional): The API key for authentication. If not provided, will try to get from environment variable MEM0_API_KEY (default: :obj:`None`).
+- **user_id** (str, optional): Default user ID to associate memories with (default: :obj:`None`).
+- **metadata** (Dict[str, Any], optional): Default metadata to include with all memories (default: :obj:`None`).
+- **References**:
+- **https**: //docs.mem0.ai
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ agent_id: str,
+ api_key: Optional[str] = None,
+ user_id: Optional[str] = None,
+ metadata: Optional[Dict[str, Any]] = None
+):
+```
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage._prepare_options"></a>
+
+### _prepare_options
+
+```python
+def _prepare_options(
+ self,
+ agent_id: Optional[str] = None,
+ user_id: Optional[str] = None,
+ metadata: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+):
+```
+
+Helper method to prepare options for Mem0 API calls.
+
+**Parameters:**
+
+- **agent_id** (Optional[str], optional): Agent ID to use (default: :obj:`None`).
+- **user_id** (Optional[str], optional): User ID to use (default: :obj:`None`).
+- **metadata** (Optional[Dict[str, Any]], optional): Additional metadata to include (default: :obj:`None`). **kwargs (Any): Additional keyword arguments.
+
+**Returns:**
+
+ Dict[str, Any]: Prepared options dictionary for API calls.
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage._prepare_messages"></a>
+
+### _prepare_messages
+
+```python
+def _prepare_messages(self, records: List[Dict[str, Any]]):
+```
+
+Prepare messages from records for Mem0 API calls.
+
+**Parameters:**
+
+- **records** (List[Dict[str, Any]]): List of record dictionaries.
+
+**Returns:**
+
+ List[Dict[str, Any]]: List of prepared message dictionaries.
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage.save"></a>
+
+### save
+
+```python
+def save(self, records: List[Dict[str, Any]]):
+```
+
+Saves a batch of records to the Mem0 storage system.
+
+**Parameters:**
+
+- **records** (List[Dict[str, Any]]): A list of dictionaries, where each dictionary represents a unique record to be stored.
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage.load"></a>
+
+### load
+
+```python
+def load(self):
+```
+
+**Returns:**
+
+ List[Dict[str, Any]]: A list of dictionaries, where each dictionary
+represents a stored record.
+
+<a id="camel.storages.key_value_storages.mem0_cloud.Mem0Storage.clear"></a>
+
+### clear
+
+```python
+def clear(
+ self,
+ agent_id: Optional[str] = None,
+ user_id: Optional[str] = None
+):
+```
+
+Removes all records from the Mem0 storage system.
+
+**Parameters:**
+
+- **agent_id** (Optional[str]): Specific agent ID to clear memories for.
+- **user_id** (Optional[str]): Specific user ID to clear memories for.
diff --git a/docs/reference/camel.storages.object_storages.amazon_s3.md b/docs/reference/camel.storages.object_storages.amazon_s3.md
new file mode 100644
index 000000000..06b48cfaa
--- /dev/null
+++ b/docs/reference/camel.storages.object_storages.amazon_s3.md
@@ -0,0 +1,152 @@
+<a id="camel.storages.object_storages.amazon_s3"></a>
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage"></a>
+
+## AmazonS3Storage
+
+```python
+class AmazonS3Storage(BaseObjectStorage):
+```
+
+A class to connect with AWS S3 object storage to put and get objects
+from one S3 bucket. The class will first try to use the credentials passed
+as arguments, if not provided, it will look for the environment variables
+`AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. If none of these are
+provided, it will try to use the local credentials (will be created if
+logged in with AWS CLI).
+
+**Parameters:**
+
+- **bucket_name** (str): The name of the S3 bucket.
+- **create_if_not_exists** (bool, optional): Whether to create the bucket if it does not exist. Defaults to True.
+- **access_key_id** (Optional[str], optional): The AWS access key ID. Defaults to None.
+- **secret_access_key** (Optional[str], optional): The AWS secret access key. Defaults to None.
+- **anonymous** (bool, optional): Whether to use anonymous access. Defaults to False.
+- **References**:
+- **https**: //aws.amazon.com/pm/serv-s3/
+- **https**: //aws.amazon.com/cli/
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ bucket_name: str,
+ create_if_not_exists: bool = True,
+ access_key_id: Optional[str] = None,
+ secret_access_key: Optional[str] = None,
+ anonymous: bool = False
+):
+```
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._prepare_and_check"></a>
+
+### _prepare_and_check
+
+```python
+def _prepare_and_check(self):
+```
+
+Check privileges and existence of the bucket.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage.canonicalize_path"></a>
+
+### canonicalize_path
+
+```python
+def canonicalize_path(file_path: PurePath):
+```
+
+Canonicalize file path for Amazon S3.
+
+**Parameters:**
+
+- **file_path** (PurePath): The path to be canonicalized.
+
+**Returns:**
+
+ Tuple[str, str]: The canonicalized file key and file name.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._put_file"></a>
+
+### _put_file
+
+```python
+def _put_file(self, file_key: str, file: File):
+```
+
+Put a file to the Amazon S3 bucket.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the bucket.
+- **file** (File): The file to be uploaded.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._get_file"></a>
+
+### _get_file
+
+```python
+def _get_file(self, file_key: str, filename: str):
+```
+
+Get a file from the Amazon S3 bucket.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the bucket.
+- **filename** (str): The name of the file.
+
+**Returns:**
+
+ File: The object from the S3 bucket.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._upload_file"></a>
+
+### _upload_file
+
+```python
+def _upload_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Upload a local file to the Amazon S3 bucket.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be uploaded.
+- **remote_file_key** (str): The path to the object in the bucket.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._download_file"></a>
+
+### _download_file
+
+```python
+def _download_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Download a file from the Amazon S3 bucket to the local system.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be saved.
+- **remote_file_key** (str): The key of the object in the bucket.
+
+<a id="camel.storages.object_storages.amazon_s3.AmazonS3Storage._object_exists"></a>
+
+### _object_exists
+
+```python
+def _object_exists(self, file_key: str):
+```
+
+Check if the object exists in the Amazon S3 bucket.
+
+**Parameters:**
+
+- **file_key**: The key of the object in the bucket.
+
+**Returns:**
+
+ bool: Whether the object exists in the bucket.
diff --git a/docs/reference/camel.storages.object_storages.azure_blob.md b/docs/reference/camel.storages.object_storages.azure_blob.md
new file mode 100644
index 000000000..ea16da013
--- /dev/null
+++ b/docs/reference/camel.storages.object_storages.azure_blob.md
@@ -0,0 +1,145 @@
+<a id="camel.storages.object_storages.azure_blob"></a>
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage"></a>
+
+## AzureBlobStorage
+
+```python
+class AzureBlobStorage(BaseObjectStorage):
+```
+
+A class to connect to Azure Blob Storage. It will connect to one
+container in the storage account.
+
+**Parameters:**
+
+- **storage_account_name** (str): The name of the storage account.
+- **container_name** (str): The name of the container.
+- **access_key** (Optional[str], optional): The access key of the storage account. Defaults to None.
+- **References**:
+- **https**: //azure.microsoft.com/en-us/products/storage/blobs
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ storage_account_name: str,
+ container_name: str,
+ create_if_not_exists: bool = True,
+ access_key: Optional[str] = None
+):
+```
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._prepare_and_check"></a>
+
+### _prepare_and_check
+
+```python
+def _prepare_and_check(self):
+```
+
+Check privileges and existence of the container.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage.canonicalize_path"></a>
+
+### canonicalize_path
+
+```python
+def canonicalize_path(file_path: PurePath):
+```
+
+Canonicalize file path for Azure Blob Storage.
+
+**Parameters:**
+
+- **file_path** (PurePath): The path to be canonicalized.
+
+**Returns:**
+
+ Tuple[str, str]: The canonicalized file key and file name.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._put_file"></a>
+
+### _put_file
+
+```python
+def _put_file(self, file_key: str, file: File):
+```
+
+Put a file to the Azure Blob Storage container.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the container.
+- **file** (File): The file to be uploaded.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._get_file"></a>
+
+### _get_file
+
+```python
+def _get_file(self, file_key: str, filename: str):
+```
+
+Get a file from the Azure Blob Storage container.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the container.
+- **filename** (str): The name of the file.
+
+**Returns:**
+
+ File: The object from the container.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._upload_file"></a>
+
+### _upload_file
+
+```python
+def _upload_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Upload a local file to the Azure Blob Storage container.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be uploaded.
+- **remote_file_key** (str): The path to the object in the container.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._download_file"></a>
+
+### _download_file
+
+```python
+def _download_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Download a file from the Azure Blob Storage container to the local
+system.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be saved.
+- **remote_file_key** (str): The key of the object in the container.
+
+<a id="camel.storages.object_storages.azure_blob.AzureBlobStorage._object_exists"></a>
+
+### _object_exists
+
+```python
+def _object_exists(self, file_key: str):
+```
+
+Check if the object exists in the Azure Blob Storage container.
+
+**Parameters:**
+
+- **file_key**: The key of the object in the container.
+
+**Returns:**
+
+ bool: Whether the object exists in the container.
diff --git a/docs/reference/camel.storages.object_storages.google_cloud.md b/docs/reference/camel.storages.object_storages.google_cloud.md
new file mode 100644
index 000000000..fc5014378
--- /dev/null
+++ b/docs/reference/camel.storages.object_storages.google_cloud.md
@@ -0,0 +1,148 @@
+<a id="camel.storages.object_storages.google_cloud"></a>
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage"></a>
+
+## GoogleCloudStorage
+
+```python
+class GoogleCloudStorage(BaseObjectStorage):
+```
+
+A class to connect to Google Cloud Storage. It will connect to one
+bucket in the storage account.
+
+Note that Google Cloud Storage does not support api key authentication.
+Therefore, before using this class, you need to log in with gcloud command
+line tool and save the credentials first.
+
+**Parameters:**
+
+- **bucket_name** (str): The name of the bucket.
+- **create_if_not_exists** (bool, optional): Whether to create the bucket if it does not exist. Defaults to True.
+- **anonymous** (bool, optional): Whether to use anonymous access. Defaults to False.
+- **References**:
+- **https**: //cloud.google.com/storage
+- **https**: //cloud.google.com/docs/authentication/api-keys
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ bucket_name: str,
+ create_if_not_exists: bool = True,
+ anonymous: bool = False
+):
+```
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage.canonicalize_path"></a>
+
+### canonicalize_path
+
+```python
+def canonicalize_path(file_path: PurePath):
+```
+
+Canonicalize the path for Google Cloud Storage.
+
+**Parameters:**
+
+- **file_path** (PurePath): The path to be canonicalized.
+
+**Returns:**
+
+ Tuple[str, str]: The canonicalized file key and file name.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._prepare_and_check"></a>
+
+### _prepare_and_check
+
+```python
+def _prepare_and_check(self):
+```
+
+Check privileges and existence of the bucket.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._put_file"></a>
+
+### _put_file
+
+```python
+def _put_file(self, file_key: str, file: File):
+```
+
+Put a file to the GCloud bucket.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the bucket.
+- **file** (File): The file to be uploaded.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._get_file"></a>
+
+### _get_file
+
+```python
+def _get_file(self, file_key: str, filename: str):
+```
+
+Get a file from the GCloud bucket.
+
+**Parameters:**
+
+- **file_key** (str): The path to the object in the bucket.
+- **filename** (str): The name of the file.
+
+**Returns:**
+
+ File: The object from the S3 bucket.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._upload_file"></a>
+
+### _upload_file
+
+```python
+def _upload_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Upload a local file to the GCloud bucket.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be uploaded.
+- **remote_file_key** (str): The path to the object in the bucket.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._download_file"></a>
+
+### _download_file
+
+```python
+def _download_file(self, local_file_path: Path, remote_file_key: str):
+```
+
+Download a file from the GCloud bucket to the local system.
+
+**Parameters:**
+
+- **local_file_path** (Path): The path to the local file to be saved.
+- **remote_file_key** (str): The key of the object in the bucket.
+
+<a id="camel.storages.object_storages.google_cloud.GoogleCloudStorage._object_exists"></a>
+
+### _object_exists
+
+```python
+def _object_exists(self, file_key: str):
+```
+
+Check if the object exists in the GCloud bucket.
+
+**Parameters:**
+
+- **file_key**: The key of the object in the bucket.
+
+**Returns:**
+
+ bool: Whether the object exists in the bucket.
diff --git a/docs/reference/camel.toolkits.wechat_official_toolkit.md b/docs/reference/camel.toolkits.wechat_official_toolkit.md
new file mode 100644
index 000000000..429c2da03
--- /dev/null
+++ b/docs/reference/camel.toolkits.wechat_official_toolkit.md
@@ -0,0 +1,258 @@
+<a id="camel.toolkits.wechat_official_toolkit"></a>
+
+<a id="camel.toolkits.wechat_official_toolkit._get_wechat_access_token"></a>
+
+## _get_wechat_access_token
+
+```python
+def _get_wechat_access_token():
+```
+
+**Returns:**
+
+ str: The valid access token.
+
+**Raises:**
+
+- **ValueError**: If credentials are missing or token retrieval fails.
+- **References**:
+- **https**: //developers.weixin.qq.com/doc/offiaccount/Basic_Information/Get_access_token.html
+
+<a id="camel.toolkits.wechat_official_toolkit._make_wechat_request"></a>
+
+## _make_wechat_request
+
+```python
+def _make_wechat_request(method: Literal['GET', 'POST'], endpoint: str, **kwargs):
+```
+
+Makes a request to WeChat API with proper error handling.
+
+**Parameters:**
+
+- **method** (`Literal["GET", "POST"]`): HTTP method ('GET' or 'POST').
+- **endpoint** (str): API endpoint path. **kwargs: Additional arguments for requests.
+
+**Returns:**
+
+ Dict[str, Any]: API response data.
+
+**Raises:**
+
+- **requests.exceptions.RequestException**: If request fails.
+- **ValueError**: If API returns an error.
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit"></a>
+
+## WeChatOfficialToolkit
+
+```python
+class WeChatOfficialToolkit(BaseToolkit):
+```
+
+A toolkit for WeChat Official Account operations.
+
+This toolkit provides methods to interact with the WeChat Official Account
+API, allowing users to send messages, manage users, and handle media files.
+
+References:
+- Documentation: https://developers.weixin.qq.com/doc/offiaccount/Getting_Started/Overview.html
+- Test Account: https://mp.weixin.qq.com/debug/cgi-bin/sandbox?t=sandbox/login
+
+**Note:**
+
+Set environment variables: WECHAT_APP_ID, WECHAT_APP_SECRET
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.__init__"></a>
+
+### __init__
+
+```python
+def __init__(self, timeout: Optional[float] = None):
+```
+
+Initializes the WeChatOfficialToolkit.
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.send_customer_message"></a>
+
+### send_customer_message
+
+```python
+def send_customer_message(
+ self,
+ openid: str,
+ content: str,
+ msgtype: Literal['text', 'image', 'voice', 'video'] = 'text'
+):
+```
+
+Sends a customer service message to a WeChat user.
+
+**Parameters:**
+
+- **openid** (str): The user's OpenID.
+- **content** (str): Message content or media_id for non-text messages.
+- **msgtype** (str): Message type: "text", "image", "voice", "video".
+
+**Returns:**
+
+ str: Success or error message.
+
+References:
+https://developers.weixin.qq.com/doc/offiaccount/Message_Management/Service_Center_messages.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.get_user_info"></a>
+
+### get_user_info
+
+```python
+def get_user_info(self, openid: str, lang: str = 'zh_CN'):
+```
+
+Retrieves WeChat user information.
+
+**Parameters:**
+
+- **openid** (str): The user's OpenID.
+- **lang** (str): Response language. Common values: "zh_CN", "zh_TW", "en". (default: "zh_CN")
+
+**Returns:**
+
+ Dict[str, Any]: User information as dictionary or error
+information.
+
+References:
+https://developers.weixin.qq.com/doc/offiaccount/User_Management/
+Getting_user_basic_information.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.get_followers_list"></a>
+
+### get_followers_list
+
+```python
+def get_followers_list(self, next_openid: str = ''):
+```
+
+Retrieves list of followers' OpenIDs.
+
+**Parameters:**
+
+- **next_openid** (str): Starting OpenID for pagination. (default: "") (default: `""`)
+
+**Returns:**
+
+ Dict[str, Any]: Followers list as dictionary or error information.
+
+References:
+https://developers.weixin.qq.com/doc/offiaccount/User_Management/
+Getting_a_list_of_followers.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.upload_wechat_media"></a>
+
+### upload_wechat_media
+
+```python
+def upload_wechat_media(
+ self,
+ media_type: Literal['image', 'voice', 'video', 'thumb'],
+ file_path: str,
+ permanent: bool = False,
+ description: Optional[str] = None
+):
+```
+
+Uploads media file to WeChat.
+
+**Parameters:**
+
+- **media_type** (str): Media type: "image", "voice", "video", "thumb".
+- **file_path** (str): Local file path.
+- **permanent** (bool): Whether to upload as permanent media. (default: :obj:`False`)
+- **description** (Optional[str]): Video description in JSON format for permanent upload. (default: :obj:`None`)
+
+**Returns:**
+
+ Dict[str, Any]: Upload result with media_id or error information.
+
+References:
+- Temporary: https://developers.weixin.qq.com/doc/offiaccount/
+Asset_Management/Adding_Temporary_Assets.html
+- Permanent: https://developers.weixin.qq.com/doc/offiaccount/
+Asset_Management/Adding_Permanent_Assets.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.get_media_list"></a>
+
+### get_media_list
+
+```python
+def get_media_list(
+ self,
+ media_type: Literal['image', 'voice', 'video', 'news'],
+ offset: int = 0,
+ count: int = 20
+):
+```
+
+Gets list of permanent media files.
+
+**Parameters:**
+
+- **media_type** (str): Media type: "image", "voice", "video", "news".
+- **offset** (int): Starting position. (default: :obj:`0`) (default: 0)
+- **count** (int): Number of items (1-20). (default: :obj:`20`) (default: 20)
+
+**Returns:**
+
+ Dict[str, Any]: Media list as dictionary or error information.
+
+References:
+https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/
+Get_the_list_of_all_materials.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.send_mass_message_to_all"></a>
+
+### send_mass_message_to_all
+
+```python
+def send_mass_message_to_all(
+ self,
+ content: str,
+ msgtype: Literal['text', 'image', 'voice', 'video'] = 'text',
+ clientmsgid: Optional[str] = None,
+ send_ignore_reprint: Optional[int] = 0,
+ batch_size: int = 10000
+):
+```
+
+Sends a mass message to all followers (by OpenID list).
+
+This method paginates all follower OpenIDs and calls the
+mass-send API in batches.
+
+**Parameters:**
+
+- **content** (str): For text, the message content; for non-text, the media_id.
+- **msgtype** (`Literal["text","image","voice","video"]`): Message type. For "video", the mass API expects "mpvideo" internally.
+- **clientmsgid** (Optional[str]): Idempotency key to avoid duplicate mass jobs.
+- **send_ignore_reprint** (Optional[int]): Whether to continue when a news article is judged as a reprint (reserved; applies to news/mpnews).
+- **batch_size** (int): Max OpenIDs per request (WeChat limit is up to 10000 per batch).
+
+**Returns:**
+
+ Dict[str, Any]: Aggregated result including counts and
+each batch response.
+
+References:
+- Mass send by OpenID list:
+https://developers.weixin.qq.com/doc/service/api/notify/message/
+api_masssend.html
+
+<a id="camel.toolkits.wechat_official_toolkit.WeChatOfficialToolkit.get_tools"></a>
+
+### get_tools
+
+```python
+def get_tools(self):
+```
+
+Returns toolkit functions as tools.