Skip to content

Conversation

@vipyne
Copy link

@vipyne vipyne commented Dec 9, 2025

cc @duncankmckinnon


Note

Refactors the Pipecat OpenInference observer to use turn-tracking with expanded frame handling and precise span lifecycle/metrics, and updates LLM model name extraction to prefer _full_model_name.

  • Observer refactor (_observer.py):
    • Change OpenInferenceObserver to inherit from TurnTrackingObserver and UserBotLatencyLogObserver; remove custom turn state and delegate to super.
    • Expand handled frames (LLM*, TTS*, VADUser*, MetricsFrame, etc.) and route through _handle_service_frame.
    • Start service spans on VADUserStartedSpeakingFrame (STT), LLMFullResponseStartFrame (LLM), and TTSStartedFrame (TTS); finish spans on EndFrame, CancelFrame, ErrorFrame, LLMFullResponseEndFrame, BotStoppedSpeakingFrame, and STT completion after VADUserStoppedSpeakingFrame + final TranscriptionFrame.
    • Accumulate user (TranscriptionFrame) and bot (TTSTextFrame, LLMTextFrame) text; set input.value/output.value on span/turn with spacing based on includes_inter_frame_spaces.
    • Process MetricsFrame to set attributes (e.g., service.processing_time_seconds) and compute span end times; attach conversation.user_to_bot_latency.
    • Create service spans as children of pipecat.conversation.turn; update turn start/end (_start_turn, _end_turn) and attributes (conversation.turn_number, duration, end reason).
  • Attributes (_attributes.py):
    • Update LLMServiceAttributeExtractor to prefer service._full_model_name for llm.model_name, falling back to model_name/model.

Written by Cursor Bugbot for commit 0232542. This will update automatically on new commits. Configure here.

@vipyne vipyne requested a review from a team as a code owner December 9, 2025 18:27
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 9, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request

@vipyne vipyne marked this pull request as draft December 9, 2025 18:29
@vipyne vipyne force-pushed the vp-incorporate-pipecat-refactor branch from 0232542 to fefe8a3 Compare December 12, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant