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:
Eric Zhu
2024-08-19 07:06:41 -07:00
committed by GitHub
parent eb4a5b7df5
commit 5eca0dba4a
15 changed files with 515 additions and 188 deletions

View File

@@ -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__":