mirror of
https://github.com/microsoft/autogen.git
synced 2026-02-14 12:05:07 -05:00
Python host and worker runtime for distributed agents. (#369)
* Python host runtime impl * update * ignore proto generated files * move worker runtime to application * Move example to samples * Fix import * fix * update * server client * better shutdown * fix doc conf * add type
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import asyncio
|
||||
import logging
|
||||
|
||||
from agnext.application import WorkerAgentRuntime
|
||||
from agnext.core._serialization import MESSAGE_TYPE_REGISTRY
|
||||
from agnext.worker.worker_runtime import WorkerAgentRuntime
|
||||
from app import build_app
|
||||
from dotenv import load_dotenv
|
||||
from messages import ArticleCreated, AuditorAlert, AuditText, GraphicDesignCreated
|
||||
@@ -18,7 +18,7 @@ async def main() -> None:
|
||||
MESSAGE_TYPE_REGISTRY.add_type(AuditText)
|
||||
MESSAGE_TYPE_REGISTRY.add_type(AuditorAlert)
|
||||
agnext_logger.info("1")
|
||||
await runtime.setup_channel("localhost:5145")
|
||||
await runtime.start("localhost:5145")
|
||||
|
||||
agnext_logger.info("2")
|
||||
|
||||
@@ -30,7 +30,7 @@ async def main() -> None:
|
||||
await asyncio.sleep(1000000)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
await runtime.close_channel()
|
||||
await runtime.stop()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user