You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AutoGen is about Agents and Agent Orchestration. CAP extends AutoGen to allows Agents to communicate via a message bus. CAP, therefore, deals with the space between these components. CAP is a message based, actor platform that allows actors to be composed into arbitrary graphs.
15
15
16
16
Actors can register themselves with CAP, find other agents, construct arbitrary graphs, send and receive messages independently and many, many, many other things.
17
+
17
18
```python
18
-
# CAP Platform
19
-
network = LocalActorNetwork()
20
-
# Register an agent
21
-
network.register(GreeterAgent())
22
-
# Tell agents to connect to other agents
23
-
network.connect()
24
-
# Get a channel to the agent
25
-
greeter_link = network.lookup_agent("Greeter")
26
-
# Send a message to the agent
27
-
greeter_link.send_txt_msg("Hello World!")
28
-
# Cleanup
29
-
greeter_link.close()
30
-
network.disconnect()
19
+
# CAP Library
20
+
from autogencap.ComponentEnsemble import ComponentEnsemble
21
+
from autogencap.Actor import Actor
22
+
23
+
# A simple Agent
24
+
class GreeterAgent(Actor):
25
+
def __init__(self):
26
+
super().__init__(
27
+
agent_name="Greeter",
28
+
description="This is the greeter agent, who knows how to greet people.")
0 commit comments