Skip to content

docs(pipecat): document instrument_user_aggregator for realtime user transcript#4948

Merged
Caroline di Vittorio (carolinedivittorio) merged 2 commits into
mainfrom
pipecat-realtime-instrument-user-transcript-docs
Jul 17, 2026
Merged

docs(pipecat): document instrument_user_aggregator for realtime user transcript#4948
Caroline di Vittorio (carolinedivittorio) merged 2 commits into
mainfrom
pipecat-realtime-instrument-user-transcript-docs

Conversation

@carolinedivittorio

Copy link
Copy Markdown
Contributor

Summary

A speech-to-speech (realtime) Pipecat model (for example, OpenAIRealtimeLLMService) has no separate speech-to-text stage, so the user's transcript is never emitted as an OTel span — it arrives through the user context aggregator's on_user_turn_message_added callback. Without wiring it up, the trace shows only the assistant side.

This mirrors what the LiveKit integration docs did for instrument_session, but for the Pipecat integration's instrument_user_aggregator.

Changes

  • New section "When using Pipecat with a realtime model" in src/langsmith/trace-with-pipecat.mdx, placed after "Group a conversation into a thread" (matching the LiveKit doc's structure):
    • Explains that realtime models deliver the user transcript through the user context aggregator, not an OTel span.
    • Shows calling span_processor.instrument_user_aggregator(context_aggregator, conversation_id) right after building the aggregator, correlating by the id set with set_thread_id.
    • Notes that OpenAI Realtime additionally requires input-audio transcription (InputAudioTranscription) on the session, or the aggregator never fires (the model receives raw audio and produces no user-side text). Other realtime services that surface user text through the aggregator themselves (e.g. Gemini Live) need only the instrument_user_aggregator call.
    • Warns not to call it for the STT/LLM/TTS cascade, where the transcript is already captured from the speech-to-text step (would double-count the user's turns).
    • Pins the new API to langsmith[pipecat]>=0.10.6 (the release that introduced instrument_user_aggregator).
  • Updated the intro paragraph to note realtime models need one extra call and link to the new section (same shape as the LiveKit doc).

Verification

  • instrument_user_aggregator was confirmed to ship in published langsmith==0.10.6 (absent in 0.10.4 / 0.10.5), so the >=0.10.6 pin is accurate.
  • The OpenAI Realtime session config (AudioInput / InputAudioTranscription) and LLMContextAggregatorPair(..., realtime_service_mode=True) in the example match the instrumented demo in feat(pipecat): capture realtime user transcript in openai + gemini demos voice-demo#15.
  • Anchor #when-using-pipecat-with-a-realtime-model matches the generated heading slug.

…transcript

Add a section on capturing the realtime (speech-to-speech) user transcript via
span_processor.instrument_user_aggregator, and note it must not be used with the
cascade (where it would double-count the user's turns). Mirrors the
instrument_session guidance added for the LiveKit integration.

Also call out that OpenAI Realtime needs input-audio transcription
(InputAudioTranscription) enabled on the session or the aggregator never fires,
and pin the new API to langsmith[pipecat]>=0.10.6 (where it was introduced).
@github-actions github-actions Bot added the langsmith For docs changes to LangSmith label Jul 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for opening a docs PR, Caroline di Vittorio (@carolinedivittorio)! When it's ready for review, please add the relevant reviewers:

  • @katmayb or @fjmorris (LangSmith)

@github-actions

Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-pipeca-1784309653-931857a

Site preview: https://langchain-5e9cc07a-preview-pipeca-1784309653-931857a.mintlify.site

Important

Preview links may take a few minutes to start working while the deployment finishes.

Changed documentation pages (preview deep links):

@carolinedivittorio
Caroline di Vittorio (carolinedivittorio) merged commit a83ae72 into main Jul 17, 2026
24 checks passed
@carolinedivittorio
Caroline di Vittorio (carolinedivittorio) deleted the pipecat-realtime-instrument-user-transcript-docs branch July 17, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal langsmith For docs changes to LangSmith

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants