Skip to content

Commit 6530e78

Browse files
author
camel-docs-bot
committed
Auto-update documentation after merge [skip ci]
1 parent 0c013f4 commit 6530e78

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

docs/mintlify/reference/camel.societies.workforce.workforce.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,11 @@ Clean up tracking data for a task to prevent memory leaks.
526526
### _decompose_task
527527

528528
```python
529-
def _decompose_task(self, task: Task):
529+
def _decompose_task(
530+
self,
531+
task: Task,
532+
stream_callback: Optional[Callable[['ChatAgentResponse'], None]] = None
533+
):
530534
```
531535

532536
Decompose the task into subtasks. This method will also set the
@@ -535,6 +539,7 @@ relationship between the task and its subtasks.
535539
**Parameters:**
536540

537541
- **task** (Task): The task to decompose.
542+
- **stream_callback** (Callable[[ChatAgentResponse], None], optional): A callback function that receives each chunk (ChatAgentResponse) during streaming decomposition.
538543

539544
**Returns:**
540545

docs/mintlify/reference/camel.tasks.task.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ def decompose(
298298
self,
299299
agent: 'ChatAgent',
300300
prompt: Optional[str] = None,
301-
task_parser: Callable[[str, str], List['Task']] = parse_response
301+
task_parser: Callable[[str, str], List['Task']] = parse_response,
302+
stream_callback: Optional[Callable[['ChatAgentResponse'], None]] = None
302303
):
303304
```
304305

@@ -310,6 +311,7 @@ streaming or non-streaming based on agent configuration.
310311
- **agent** (ChatAgent): An agent that used to decompose the task.
311312
- **prompt** (str, optional): A prompt to decompose the task. If not provided, the default prompt will be used.
312313
- **task_parser** (Callable[[str, str], List[Task]], optional): A function to extract Task from response. If not provided, the default parse_response will be used.
314+
- **stream_callback** (Callable[[ChatAgentResponse], None], optional): A callback function that receives each chunk (ChatAgentResponse) during streaming. This allows tracking the decomposition progress in real-time.
313315

314316
**Returns:**
315317

@@ -325,8 +327,9 @@ all tasks.
325327
```python
326328
def _decompose_streaming(
327329
self,
328-
response: 'StreamingChatAgentResponse',
329-
task_parser: Callable[[str, str], List['Task']]
330+
response: Iterable,
331+
task_parser: Callable[[str, str], List['Task']],
332+
stream_callback: Optional[Callable[['ChatAgentResponse'], None]] = None
330333
):
331334
```
332335

@@ -336,6 +339,7 @@ Handle streaming response for task decomposition.
336339

337340
- **response**: Streaming response from agent
338341
- **task_parser**: Function to parse tasks from response
342+
- **stream_callback** (Callable[[ChatAgentResponse], None], optional): A callback function that receives each chunk (ChatAgentResponse) during streaming.
339343
- **Yields**: List[Task]: New tasks as they are parsed from streaming response
340344

341345
<a id="camel.tasks.task.Task._decompose_non_streaming"></a>

0 commit comments

Comments
 (0)