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-bot1244ef11cb40
diff --git a/docs/mintlify/reference/camel.societies.workforce.single_agent_worker.mdx b/docs/mintlify/reference/camel.societies.workforce.single_agent_worker.mdx
index 37688012e..b630815f7 100644
--- a/docs/mintlify/reference/camel.societies.workforce.single_agent_worker.mdx
+++ b/docs/mintlify/reference/camel.societies.workforce.single_agent_worker.mdx
@@ -257,8 +257,8 @@ def _generate_workflow_filename(self):
**Returns:**
- str: Sanitized filename without timestamp (session already has
-timestamp).
+ str: Sanitized filename without timestamp and without .md
+extension. Format: \{role_name\}_workflow
<a id="camel.societies.workforce.single_agent_worker.SingleAgentWorker._prepare_workflow_prompt"></a>
diff --git a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
index b185053c4..ddf2d8015 100644
--- a/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
+++ b/docs/mintlify/reference/camel.societies.workforce.workforce.mdx
@@ -101,9 +101,18 @@ def __init__(
### _get_or_create_shared_context_utility
```python
-def _get_or_create_shared_context_utility(self):
+def _get_or_create_shared_context_utility(self, session_id: Optional[str] = None):
```
+Get or create the shared context utility for workflow management.
+
+This method creates the context utility only when needed, avoiding
+unnecessary session folder creation during initialization.
+
+**Parameters:**
+
+- **session_id** (Optional[str]): Custom session ID to use. If None, auto-generates a timestamped session ID. (default: :obj:`None`)
+
**Returns:**
ContextUtility: The shared context utility instance.
@@ -693,9 +702,22 @@ be called when the workforce is not running.
### save_workflow_memories
```python
-def save_workflow_memories(self):
+def save_workflow_memories(self, session_id: Optional[str] = None):
```
+Save workflow memories for all SingleAgentWorker instances in the
+workforce.
+
+This method iterates through all child workers and triggers workflow
+saving for SingleAgentWorker instances using their
+save_workflow_memories()
+method.
+Other worker types are skipped.
+
+**Parameters:**
+
+- **session_id** (Optional[str]): Custom session ID to use for saving workflows. If None, auto-generates a timestamped session ID. Useful for organizing workflows by project or context. (default: :obj:`None`)
+
**Returns:**
Dict[str, str]: Dictionary mapping worker node IDs to save results.
diff --git a/docs/mintlify/reference/camel.utils.context_utils.mdx b/docs/mintlify/reference/camel.utils.context_utils.mdx
index 42c5022b0..8f9745e5c 100644
--- a/docs/mintlify/reference/camel.utils.context_utils.mdx
+++ b/docs/mintlify/reference/camel.utils.context_utils.mdx
@@ -96,6 +96,33 @@ def _generate_session_id(self):
Create timestamp-based unique identifier for isolating
current session files from other sessions.
+<a id="camel.utils.context_utils.ContextUtility.sanitize_workflow_filename"></a>
+
+### sanitize_workflow_filename
+
+```python
+def sanitize_workflow_filename(name: str, max_length: Optional[int] = None):
+```
+
+Sanitize a name string for use as a workflow filename.
+
+Converts the input string to a safe filename by:
+- converting to lowercase
+- replacing spaces with underscores
+- removing special characters (keeping only alphanumeric and
+underscores)
+- truncating to maximum length if specified
+
+**Parameters:**
+
+- **name** (str): The name string to sanitize (e.g., role_name or task_title).
+- **max_length** (Optional[int]): Maximum length for the sanitized filename. If None, uses MAX_WORKFLOW_FILENAME_LENGTH. (default: :obj:`None`)
+
+**Returns:**
+
+ str: Sanitized filename string suitable for filesystem use.
+Returns "agent" if sanitization results in empty string.
+
<a id="camel.utils.context_utils.ContextUtility._ensure_directory_exists"></a>
### _ensure_directory_exists