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

camel-docs-bot15a5bfdbf8b8
diff --git a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
index 8fd94f0cb..ef16e1b5b 100644
--- a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
+++ b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
@@ -139,6 +139,20 @@ def _sync_shared_memory(self):
Synchronize memory across all agents by collecting and sharing.
+<a id="camel.societies.workforce.workforce.Workforce._cleanup_task_tracking"></a>
+
+### _cleanup_task_tracking
+
+```python
+def _cleanup_task_tracking(self, task_id: str):
+```
+
+Clean up tracking data for a task to prevent memory leaks.
+
+**Parameters:**
+
+- **task_id** (str): The ID of the task to clean up.
+
<a id="camel.societies.workforce.workforce.Workforce._decompose_task"></a>
### _decompose_task
@@ -367,7 +381,7 @@ def add_single_agent_worker(
self,
description: str,
worker: ChatAgent,
- pool_max_size: int = 10
+ pool_max_size: int = DEFAULT_WORKER_POOL_SIZE
):
```
diff --git a/docs/mintlify/reference/camel.tasks.task.mdx b/docs/mintlify/reference/camel.tasks.task.mdx
index 21bed3386..80f080b3d 100644
--- a/docs/mintlify/reference/camel.tasks.task.mdx
+++ b/docs/mintlify/reference/camel.tasks.task.mdx
@@ -1,27 +1,66 @@
<a id="camel.tasks.task"></a>
+<a id="camel.tasks.task.TaskValidationMode"></a>
+
+## TaskValidationMode
+
+```python
+class TaskValidationMode(Enum):
+```
+
+Validation modes for different use cases.
+
<a id="camel.tasks.task.validate_task_content"></a>
## validate_task_content
```python
-def validate_task_content(content: str, task_id: str = 'unknown', min_length: int = 10):
+def validate_task_content(
+ content: str,
+ task_id: str = 'unknown',
+ min_length: int = 5,
+ mode: TaskValidationMode = TaskValidationMode.INPUT,
+ check_failure_patterns: bool = True
+):
```
-Validates task result content to avoid silent failures.
-It performs basic checks to ensure the content meets minimum
-quality standards.
+Unified validation for task content and results to avoid silent
+failures. Performs comprehensive checks to ensure content meets quality
+standards.
**Parameters:**
-- **content** (str): The task result content to validate.
+- **content** (str): The task content or result to validate.
- **task_id** (str): Task ID for logging purposes. (default: :obj:`"unknown"`)
-- **min_length** (int): Minimum content length after stripping whitespace. (default: :obj:`10`)
+- **min_length** (int): Minimum content length after stripping whitespace. (default: :obj:`5`)
+- **mode** (TaskValidationMode): Validation mode - INPUT for task content, OUTPUT for task results. (default: :obj:`TaskValidationMode.INPUT`)
+- **check_failure_patterns** (bool): Whether to check for failure indicators in the content. Only effective in OUTPUT mode. (default: :obj:`True`)
**Returns:**
bool: True if content passes validation, False otherwise.
+<a id="camel.tasks.task.is_task_result_insufficient"></a>
+
+## is_task_result_insufficient
+
+```python
+def is_task_result_insufficient(task: 'Task'):
+```
+
+Check if a task result is insufficient and should be treated as failed.
+
+This is a convenience wrapper around validate_task_content for backward
+compatibility and semantic clarity when checking task results.
+
+**Parameters:**
+
+- **task** (Task): The task to check.
+
+**Returns:**
+
+ bool: True if the result is insufficient, False otherwise.
+
<a id="camel.tasks.task.parse_response"></a>
## parse_response
@@ -77,6 +116,7 @@ Task is specific assignment that can be passed to a agent.
- **subtasks** (List[Task]): The childrent sub-tasks for the task. (default: :obj:`[]`)
- **result** (Optional[str]): The answer for the task. (default: :obj:`""`)
- **failure_count** (int): The failure count for the task. (default: :obj:`0`)
+- **assigned_worker_id** (Optional[str]): The ID of the worker assigned to this task. (default: :obj:`None`)
- **additional_info** (Optional[Dict[str, Any]]): Additional information for the task. (default: :obj:`None`)
- **image_list** (Optional[List[Image.Image]]): Optional list of PIL Image objects associated with the task. (default: :obj:`None`)
- **image_detail** (`Literal["auto", "low", "high"]`): Detail level of the images associated with the task. (default: :obj:`auto`)
diff --git a/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
index d07538ae0..34d8e1527 100644
--- a/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.human_toolkit.mdx
@@ -18,15 +18,23 @@ A class representing a toolkit for human interaction.
def ask_human_via_console(self, question: str):
```
-Ask a question to the human via the console.
+Use this tool to ask a question to the user when you are stuck,
+need clarification, or require a decision to be made. This is a
+two-way communication channel that will wait for the user's response.
+You should use it to:
+- Clarify ambiguous instructions or requirements.
+- Request missing information that you cannot find (e.g., login
+credentials, file paths).
+- Ask for a decision when there are multiple viable options.
+- Seek help when you encounter an error you cannot resolve on your own.
**Parameters:**
-- **question** (str): The question to ask the human.
+- **question** (str): The question to ask the user.
**Returns:**
- str: The answer from the human.
+ str: The user's response to the question.
<a id="camel.toolkits.human_toolkit.HumanToolkit.send_message_to_user"></a>
@@ -36,11 +44,18 @@ Ask a question to the human via the console.
def send_message_to_user(self, message: str):
```
-Send a message to the user, without waiting for
-a response. This will send to stdout in a noticeable way.
-
-This is guaranteed to reach the user regardless of
-actual user interface.
+Use this tool to send a message to the user to keep them
+informed about your progress, decisions, or actions.
+This is a one-way communication channel from you to the user and does
+not require a response. You should use it to:
+- Announce what you are about to do
+(e.g., "I will now search for papers on GUI Agents.")
+- Report the result of an action
+(e.g., "I have found 15 relevant papers.")
+- State a decision
+(e.g., "I will now analyze the top 10 papers.")
+- Inform the user about your current state if you are performing a
+task.
**Parameters:**
diff --git a/docs/mintlify/reference/camel.toolkits.non_visual_browser_toolkit.nv_browser_session.mdx b/docs/mintlify/reference/camel.toolkits.non_visual_browser_toolkit.nv_browser_session.mdx
index 7a3a137ca..bd74fa5f9 100644
--- a/docs/mintlify/reference/camel.toolkits.non_visual_browser_toolkit.nv_browser_session.mdx
+++ b/docs/mintlify/reference/camel.toolkits.non_visual_browser_toolkit.nv_browser_session.mdx
@@ -15,6 +15,16 @@ It provides a single *Page* instance plus helper utilities (snapshot &
executor). Multiple toolkits or agents can reuse this class without
duplicating Playwright setup code.
+This class is a singleton per event-loop.
+
+<a id="camel.toolkits.non_visual_browser_toolkit.nv_browser_session.NVBrowserSession.__new__"></a>
+
+### __new__
+
+```python
+def __new__(cls):
+```
+
<a id="camel.toolkits.non_visual_browser_toolkit.nv_browser_session.NVBrowserSession.__init__"></a>
### __init__
diff --git a/docs/mintlify/reference/camel.toolkits.video_download_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.video_download_toolkit.mdx
index ab4b30256..56c10ea15 100644
--- a/docs/mintlify/reference/camel.toolkits.video_download_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.video_download_toolkit.mdx
@@ -69,6 +69,15 @@ directory.
def download_video(self, url: str):
```
+Download the video and optionally split it into chunks.
+
+yt-dlp will detect if the video is downloaded automatically so there
+is no need to check if the video exists.
+
+**Parameters:**
+
+- **url** (str): The URL of the video to download.
+
**Returns:**
str: The path to the downloaded video file.
@@ -104,7 +113,7 @@ dividing the video into equal parts if an integer is provided.
**Parameters:**
-- **video_url** (str): The URL of the video to take screenshots.
+- **video_path** (str): The local path or URL of the video to take screenshots.
- **amount** (int): the amount of evenly split screenshots to capture.
**Returns:**