-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathagent_manager_docstring.txt
More file actions
executable file
·62 lines (49 loc) · 2.13 KB
/
Copy pathagent_manager_docstring.txt
File metadata and controls
executable file
·62 lines (49 loc) · 2.13 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
55
56
57
58
59
60
61
62
AgentManager Class Docstrings
=============================
Class: AgentManager
-------------------
"""Manages the lifecycle and execution of agents within the orchestrator system.
The AgentManager is responsible for registering agents, tracking their status,
and coordinating task execution across multiple agents. It provides a centralized
interface for agent management and maintains state information for all registered
agents.
Attributes:
event_bus (EventBus): The event bus instance for inter-component communication.
agents (Dict[str, BaseAgent]): Dictionary mapping agent names to agent instances.
status (Dict[str, AgentStatusEnum]): Dictionary tracking the current status of each agent.
"""
Method: __init__
----------------
"""Initialize the AgentManager with an event bus.
Args:
event_bus (EventBus): The event bus instance used for communication
between components in the orchestrator system.
"""
Method: register_agent
----------------------
"""Register a new agent with the manager.
Adds the agent to the internal registry and sets its initial status to idle.
The agent is identified by its name attribute and can be referenced for
task execution.
Args:
agent (BaseAgent): The agent instance to register. Must have a valid
name attribute that will be used as the unique identifier.
"""
Method: run_task
----------------
"""Execute a task using the specified agent.
Coordinates the execution of a task by the named agent, including status
tracking and event emission. The method handles the complete lifecycle
of task execution from start to completion or error.
Args:
agent_name (str): The name of the registered agent to execute the task.
task (Task): The task object containing all necessary information
for task execution.
Returns:
AgentOutput: The result of the task execution, containing any output
data, artifacts, or results produced by the agent.
Raises:
KeyError: If the specified agent_name is not found in the registered agents.
Exception: Any exception raised during task execution is re-raised after
updating the agent status and emitting error events.
"""