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-bot88e65435bc51
diff --git a/docs/mintlify/reference/camel.societies.workforce.utils.mdx b/docs/mintlify/reference/camel.societies.workforce.utils.mdx
index 852317819..283b35a38 100644
--- a/docs/mintlify/reference/camel.societies.workforce.utils.mdx
+++ b/docs/mintlify/reference/camel.societies.workforce.utils.mdx
@@ -151,6 +151,36 @@ def __str__(self):
def __repr__(self):
```
+<a id="camel.societies.workforce.utils.FailureHandlingConfig"></a>
+
+## FailureHandlingConfig
+
+```python
+class FailureHandlingConfig(BaseModel):
+```
+
+Configuration for failure handling behavior in Workforce.
+
+This configuration allows users to customize how the Workforce handles
+task failures. This config allows users to disable reassignment or other
+recovery strategies as needed.
+
+**Parameters:**
+
+- **max_retries** (int): Maximum number of retry attempts before giving up on a task. (default: :obj:`3`)
+- **enabled_strategies** (Optional[List[RecoveryStrategy]]): List of recovery strategies that are allowed to be used. Can be specified as RecoveryStrategy enums or strings (e.g., ["retry", "replan"]). If None, all strategies are enabled (with LLM analysis). If an empty list, no recovery strategies are applied and failed tasks are marked as failed immediately. If only ["retry"] is specified, simple retry is used without LLM analysis. (default: :obj:`None` - all strategies enabled)
+- **halt_on_max_retries** (bool): Whether to halt the entire workforce when a task exceeds max retries. If False, the task is marked as failed and the workflow continues (similar to PIPELINE mode behavior). (default: :obj:`True` for AUTO_DECOMPOSE mode behavior)
+
+<a id="camel.societies.workforce.utils.FailureHandlingConfig.validate_enabled_strategies"></a>
+
+### validate_enabled_strategies
+
+```python
+def validate_enabled_strategies(cls, v):
+```
+
+Convert string list to RecoveryStrategy enum list.
+
<a id="camel.societies.workforce.utils.FailureContext"></a>
## FailureContext
diff --git a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
index b2ce793ee..24a6b72ff 100644
--- a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
+++ b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
@@ -81,6 +81,7 @@ capabilities
- **a**: class:`ValueError` is raised. If none of the provided callbacks implement :class:`WorkforceMetrics`, a built-in :class:`WorkforceLogger` (implements both callback and metrics) is added automatically. If at least one provided callback
- **implements**: class:`WorkforceMetrics`, no default logger is added. (default: :obj:`None`)
- **mode** (WorkforceMode, optional): The execution mode for task processing. AUTO_DECOMPOSE mode uses intelligent recovery strategies (decompose, replan, etc.) when tasks fail. PIPELINE mode uses simple retry logic and allows failed tasks to continue the workflow, passing error information to dependent tasks. (default: :obj:`WorkforceMode.AUTO_DECOMPOSE`)
+- **failure_handling_config** (Optional[Union[FailureHandlingConfig, Dict]]): Configuration for customizing failure handling behavior. Can be a FailureHandlingConfig instance or a dict with the same fields. Allows fine-grained control over which recovery strategies are enabled, maximum retry attempts, and whether to halt on max retries. The `enabled_strategies` field accepts both enum values and string lists like `["retry", "replan"]`. If None, uses default configuration with all strategies enabled. (default: :obj:`None`)
**Note:**
@@ -108,7 +109,8 @@ def __init__(
use_structured_output_handler: bool = True,
task_timeout_seconds: Optional[float] = None,
mode: WorkforceMode = WorkforceMode.AUTO_DECOMPOSE,
- callbacks: Optional[List[WorkforceCallback]] = None
+ callbacks: Optional[List[WorkforceCallback]] = None,
+ failure_handling_config: Optional[Union[FailureHandlingConfig, Dict[str, Any]]] = None
):
```
@@ -547,6 +549,18 @@ relationship between the task and its subtasks.
The subtasks or generator of subtasks. Returns empty list for
PIPELINE mode.
+<a id="camel.societies.workforce.workforce.Workforce._get_available_strategies_text"></a>
+
+### _get_available_strategies_text
+
+```python
+def _get_available_strategies_text(self):
+```
+
+**Returns:**
+
+ str: Formatted text describing available strategies for the prompt.
+
<a id="camel.societies.workforce.workforce.Workforce._analyze_task"></a>
### _analyze_task