pipecat icon indicating copy to clipboard operation
pipecat copied to clipboard

deepgram: added request IDs to debug logs

Open jjmaldonis opened this issue 1 month ago • 2 comments

Deepgram request IDs are necessary for investigating behavior at the request level. This commit adds DEBUG logs that print Deepgram request IDs when using Deepgram's STT or TTS.

Example log statements:

2025-11-17 12:25:54.894 | DEBUG    | pipecat.services.deepgram.stt:_connect:242 - DeepgramSTTService#0: Websocket connection initialized: {"headers": {'dg-project-id': 'e87380a0-834e-4f9f-b6ac-38324d90fef3', 'dg-request-id': '387b6093-f8f2-410e-b2e1-649033119e76'}}
2025-11-17 12:25:56.114 | DEBUG    | pipecat.services.deepgram.tts:run_tts:122 - DeepgramTTSService#0: HTTP connection initialized: {"headers": {'dg-model-name': 'aura-2-andromeda-en', 'dg-model-uuid': 'd40bb3c8-0122-484c-87db-943c415fb7d9', 'dg-char-count': '6', 'dg-project-id': 'e87380a0-834e-4f9f-b6ac-38324d90fef3', 'dg-request-id': '477b6af6-cfce-41b1-a8b3-9db6f03744b3'}}

jjmaldonis avatar Nov 17 '25 18:11 jjmaldonis

This seems like a helpful change from a debugging standpoint. @jjmaldonis can you add a short changelog entry for this? Also, please lint the code (scripts/fix-ruff.sh) or install the pre-commit hook (uv run pre-commit install).

markbackman avatar Nov 25 '25 23:11 markbackman

Codecov Report

:x: Patch coverage is 0% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/services/deepgram/tts.py 0.00% 3 Missing :warning:
src/pipecat/services/deepgram/flux/stt.py 0.00% 2 Missing :warning:
src/pipecat/services/deepgram/stt.py 0.00% 2 Missing :warning:
Files with missing lines Coverage Δ
src/pipecat/services/deepgram/flux/stt.py 0.00% <0.00%> (ø)
src/pipecat/services/deepgram/stt.py 0.00% <0.00%> (ø)
src/pipecat/services/deepgram/tts.py 0.00% <0.00%> (ø)
:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Nov 25 '25 23:11 codecov[bot]

Hey @markbackman, sorry for the delay on this. I fixed the linting and added an entry to the changelog.

jjmaldonis avatar Dec 03 '25 14:12 jjmaldonis