Skip to content

[Bug]: Deepgram diarized transcription is not returned in litellm response #16095

@gvioss

Description

@gvioss

What happened?

When using Deepgram for audio to text transcription, you can specify diarize=true in parameters to get diarization.
In the Deepgram response, the diarized transcript and the classic one are stored in different properties.
The classic one is returned by ['results']['channel'][0]["alternatives"][0]['transcript'], the diarized one is returned by ['results']['channel'][0]["alternatives"][0]['paragraphs']['transcript'].

When I specify the diarize=true parameter, I expect that the text response property contain the diarized transcript and not the classic one as actually (see here).

Deepgram API docs

Relevant log output

curl \
  -X POST \
  -H "Authorization: Token xxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{"url":"xxxxxxxxxx"}' \
  "https://api.deepgram.com/v1/listen?smart_format=true&diarize=true&model=nova-3"

{
  "metadata": {
    ...
  },
  "results": {
    "channels": [
      {
        "alternatives": [
          {
            "transcript": "Yep. I said it before, and I'll say it again. Life moves pretty fast. You don't stop and look around once in a while, you could miss it.",
            "confidence": 0.99926823,
            "words": [
              ...
            ],
            "paragraphs": {
              "transcript": "\nSpeaker 0: Yep. I said it before, and I'll say it again. \nSpeaker 1: Life moves pretty fast. You don't stop and look around once in a while, you could miss it.",
              "paragraphs": [
                  ...
                  ],
                }
              ]
            }
          }
        ]
      }
    ]
  }
}

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.79.0

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions