-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Expand file tree
/
Copy path_team.py
More file actions
54 lines (43 loc) · 1.56 KB
/
Copy path_team.py
File metadata and controls
54 lines (43 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from abc import ABC, abstractmethod
from typing import Any, Mapping
from autogen_core import ComponentBase
from pydantic import BaseModel
from ._task import TaskRunner
class Team(ABC, TaskRunner, ComponentBase[BaseModel]):
component_type = "team"
@property
@abstractmethod
def name(self) -> str:
"""The name of the team. This is used by team to uniquely identify itself
in a larger team of teams."""
...
@property
@abstractmethod
def description(self) -> str:
"""A description of the team. This is used to provide context about the
team and its purpose to its parent orchestrator."""
...
@abstractmethod
async def reset(self) -> None:
"""Reset the team and all its participants to its initial state."""
...
@abstractmethod
async def pause(self) -> None:
"""Pause the team and all its participants. This is useful for
pausing the :meth:`autogen_agentchat.base.TaskRunner.run` or
:meth:`autogen_agentchat.base.TaskRunner.run_stream` methods from
concurrently, while keeping them alive."""
...
@abstractmethod
async def resume(self) -> None:
"""Resume the team and all its participants from a pause after
:meth:`pause` was called."""
...
@abstractmethod
async def save_state(self) -> Mapping[str, Any]:
"""Save the current state of the team."""
...
@abstractmethod
async def load_state(self, state: Mapping[str, Any]) -> None:
"""Load the state of the team."""
...