nemo_voice_agent.pipecat.bot_server
nemo_voice_agent.pipecat.bot_server
Shared bot-server runner.
Bots build their own services, RTVI processor, pipeline, and PipelineWorker;
this module handles the boilerplate that sits around the task — transport event
handlers, the RTVI on_client_ready kick-off, audio-logger finalization,
shutdown, and optional FastAPI /connect endpoint.
The runner makes no assumptions about pipeline contents: it only needs the
task, ws_transport, and rtvi the bot already constructed. Per-bot
customization (what to reset on disconnect, which initial frame to queue on
client-ready) is passed via keyword arguments.
Module Contents
Functions
Data
API
FastAPI app with CORS + /connect + a stub /ws endpoint.
/connect returns the ws URL the pipecat client should dial. /ws is
kept as a placeholder mirroring the original bot scripts’ unimplemented
FastAPI websocket path.
Wire event handlers onto ws_transport/rtvi and run the pipeline.
Parameters:
Fully constructed PipelineWorker with observers already attached.
Transport the task’s pipeline uses for I/O.
RTVI processor embedded in the pipeline. Must already have any actions the bot wants registered.
Optional TaskRef passed to the RTVI handler factories.
Populated here so handlers can reach the live pipeline worker.
Audio logger to finalize on disconnect / shutdown.
If True, queue initial_frame_factory() on client-ready.
Callable returning the Frame to kick off with
(e.g. lambda: LLMRunFrame()). Invoked once per client-ready.
Services whose .reset() is called on
client disconnect. None entries are skipped.
Optional extra async cleanup called on disconnect after the default reset logic.
Run the websocket server coroutine and uvicorn concurrently.