INNER CODE UNIT · Python

serve

feder-cr/Jobs_Applier_AI_Agent_AIHawk · src/aihawk/cli.py:156

    async def serve() -> None:
        import uvicorn

        link = await Link(opts, key=key).open()
        click.echo("server   connected, %d tools" % len(link.tools))
        click.echo("open     http://%s:%d" % (host, port))
        service = ChatService(link, brain, model_label=label)
        app = build_app(link, service)
        server = uvicorn.Server(uvicorn.Config(app, host=host, port=port,
                                               log_level="warning"))
        try:
            await server.serve()
        finally:
            await link.close()

    try:
        asyncio.run(serve())
    except KeyboardInterrupt:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…