mirror of
https://github.com/microsoft/autogen.git
synced 2025-10-01 11:06:58 +00:00

* Added Runtime Factory to support multiple implementations * Rename to ComponentEnsemble to ZMQRuntime * rename zmq_runtime * rename zmq_runtime * pre-commit fixes * pre-commit fix * pre-commit fixes and default runtime * pre-commit fixes * Rename constants * Rename Constants --------- Co-authored-by: Li Jiang <bnujli@gmail.com>
18 lines
553 B
Python
18 lines
553 B
Python
from AppAgents import GreeterAgent
|
|
from autogencap.runtime_factory import RuntimeFactory
|
|
|
|
|
|
def simple_actor_demo():
|
|
"""
|
|
Demonstrates the usage of the CAP platform by registering an actor, connecting to the actor,
|
|
sending a message, and performing cleanup operations.
|
|
"""
|
|
# CAP Platform
|
|
runtime = RuntimeFactory.get_runtime("ZMQ")
|
|
agent = GreeterAgent()
|
|
runtime.register(agent)
|
|
runtime.connect()
|
|
greeter_link = runtime.find_by_name("Greeter")
|
|
greeter_link.send_txt_msg("Hello World!")
|
|
runtime.disconnect()
|