{"record":{"id":"7e7d5d86a78c202b","repo":"BerriAI/litellm","slug":"error-transforming-deepgram-response-e-response","errorCode":null,"errorMessage":"Error transforming Deepgram response: {e}\nResponse: {raw_response.text}","messagePattern":"Error transforming Deepgram response: (.+?)\nResponse: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"litellm/llms/deepgram/audio_transcription/transformation.py","lineNumber":126,"sourceCode":"            detected_language: Final = first_channel.get(\"detected_language\")\n            response[\"language\"] = detected_language if detected_language else \"en\"\n\n            response[\"duration\"] = response_json[\"metadata\"][\"duration\"]\n\n            # Transform words to match OpenAI format\n            if \"words\" in first_alternative:\n                response[\"words\"] = [\n                    {\"word\": word[\"word\"], \"start\": word[\"start\"], \"end\": word[\"end\"]}\n                    for word in first_alternative[\"words\"]\n                ]\n\n            # Store full response in hidden params\n            response._hidden_params = response_json\n\n            return response\n\n        except Exception as e:\n            raise ValueError(f\"Error transforming Deepgram response: {e}\\nResponse: {raw_response.text}\")\n\n    def _reconstruct_diarized_transcript(self, words: list) -> str:\n        \"\"\"\n        Reconstructs a diarized transcript from words with speaker information.\n\n        Args:\n            words: List of word objects with speaker, word, and optionally punctuated_word\n\n        Returns:\n            Formatted transcript with speaker labels\n        \"\"\"\n        if not words:\n            return \"\"\n\n        segments: Final = []\n        current_speaker = None\n        current_words: list[str] = []\n","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/deepgram/audio_transcription/transformation.py#L108-L144","documentation":"Transform failure in the Deepgram transcription response handler: while mapping the Deepgram JSON (channels/alternatives/words) into the OpenAI-style shape, an expected key was missing or malformed, and the handler surfaces the exception plus the raw response text.","triggerScenarios":"Thrown at litellm/llms/deepgram/audio_transcription/transformation.py:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response in the error; Deepgram returned a payload the transformer did not expect.","Verify the requested Deepgram model and transcription options are valid for your audio input.","Upgrade litellm if the response schema differs from what your version handles."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}