You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

run_host.py 611 B

12345678910111213141516171819202122
  1. import asyncio
  2. from _types import HostConfig
  3. from _utils import load_config
  4. from autogen_ext.runtimes.grpc import GrpcWorkerAgentRuntimeHost
  5. from rich.console import Console
  6. from rich.markdown import Markdown
  7. async def main(host_config: HostConfig):
  8. host = GrpcWorkerAgentRuntimeHost(address=host_config.address)
  9. host.start()
  10. console = Console()
  11. console.print(
  12. Markdown(f"**`Distributed Host`** is now running and listening for connection at **`{host_config.address}`**")
  13. )
  14. await host.stop_when_signal()
  15. if __name__ == "__main__":
  16. asyncio.run(main(load_config().host))