nat.front_ends.fastapi.routes.async_generation#

Async generation route helpers.

Attributes#

Functions#

_job_status_to_response(worker, job)

post_async_generation(*, worker, session_manager, ...)

Build async generation POST handler.

get_async_job_status(*, worker, session_manager)

Build async generation status GET handler.

add_async_generation_routes(→ None)

Register async generation submission and status routes.

Module Contents#

logger#
_job_status_to_response(worker: Any, job)#
post_async_generation(
*,
worker: Any,
session_manager: nat.runtime.session.SessionManager,
request_type: Any,
)#

Build async generation POST handler.

get_async_job_status(
*,
worker: Any,
session_manager: nat.runtime.session.SessionManager,
)#

Build async generation status GET handler.

async add_async_generation_routes(
*,
worker: Any,
app: fastapi.FastAPI,
endpoint: Any,
session_manager: nat.runtime.session.SessionManager,
generate_body_type: Any,
response_500: dict[str, Any],
) None#

Register async generation submission and status routes.