nemo_voice_agent.pipecat.services.nemo.builders
nemo_voice_agent.pipecat.services.nemo.builders
Small composable builders for the pipecat services a voice-agent bot uses.
These are thin wrappers around the existing service constructors so bot scripts
can skip the repeated boilerplate of reading ConfigManager properties. Each
builder is independent: a bot imports only what it needs. Novel services that
aren’t covered here can still be constructed inline.
Module Contents
Functions
Data
API
Build an AudioLogger if transport.record_audio_data is enabled.
Build the LLMContext and its user/assistant aggregators.
Returns (context, user_aggregator, assistant_aggregator, original_messages).
original_messages is a fresh deep-copy of the initial message list, safe
to hand to the reset/update-prompt RTVI handler factories.
turn_taking is the service from build_turn_taking (or None
when turn-taking is disabled). Pass it. In pipecat 1.0+ the user
aggregator owns turn detection, so exactly one component may emit
UserStartedSpeakingFrame / UserStoppedSpeakingFrame, and this
argument is what decides which:
turn_takinggiven:NeMoTurnTakingServicepushes those frames itself, so we selectExternalUserTurnStrategies— the supported way to tell the aggregator an upstream processor owns turn detection. It setsenable_user_speaking_frames=Falseon both the start and stop strategy, so the aggregator stays quiet and there is no double emission. This replaces the oldtransport.can_create_user_frames=Falseknob, which pipecat removed along with transport-side VAD.turn_takingisNone(the*_nvidia.yamlconfigs, which setturn_taking.enabled: false): nothing upstream emits user-turn frames, so drive the turn from VAD directly and let the aggregator emit them. These configs used to rely on the transport’s VAD for this, which is what their now-obsoletecan_create_user_frames: truewas for. Note we name the stop strategy explicitly rather than taking pipecat’s default, which would pull inLocalSmartTurnAnalyzerV3.
Either way the strategies read the VADUserStartedSpeakingFrame /
VADUserStoppedSpeakingFrame that build_vad_processor emits right
after transport.input() — neither branch needs its own analyzer.
Omitting turn_taking falls back to re-deriving the answer from
turn_taking.enabled, which is correct for the stock builders but silently
wrong for a bot that constructs its turn-taking service inline.
Build the diarization service, or return None if diar.enabled is False.
Build the LLM service via get_llm_service_from_config.
Build the processor that segments LLM text into TTS-sized chunks.
Pipecat 1.0 removed TTSService(text_aggregator=...); aggregation now
belongs to an LLMTextProcessor sitting immediately upstream of the TTS
service. Insert the result there — pipecat silently ignores unknown
constructor kwargs, so passing the aggregator to the service instead would
quietly fall back to plain sentence splitting with no error to notice.
Returns None when tts.use_text_aggregator is False.
Build the NeMo STT service from config.
Build the TTS service via get_tts_service_from_config.
Build the turn-taking service. use_diar defaults to config_manager.USE_DIAR.
Build the Silero VAD analyzer at the transport’s input sample rate.
Wrap vad_analyzer in the pipeline processor that emits VAD frames.
Pipecat 1.0 removed vad_analyzer from TransportParams — VAD is no
longer run by the input transport. Placing a VADProcessor immediately
after transport.input() restores the old frame ordering, so
NeMoTurnTakingService keeps receiving VADUserStartedSpeakingFrame /
VADUserStoppedSpeakingFrame at exactly the point it used to.
Returns None when there is no analyzer, so callers can drop it from the
pipeline list with the same if x is not None pattern used elsewhere.
Build the no-timeout websocket server transport used by all bots.
vad_analyzer is accepted but unused: since pipecat 1.0 the transport no
longer runs VAD. Pass the analyzer to build_vad_processor and insert
the result right after transport.input() instead.
Whether to delete (True) or rename (False) a pre-existing log file on startup.
Read the server.{log_file,log_level,create_new_log,overwrite_existing_log} block.
Returns (log_file, log_level, create_new_log). Callers pair this with
setup_rotating_log from nemo_voice_agent.utils.misc to handle
the rename-existing-log dance.