{"record":{"id":"b0faaedf2f88b276","repo":"BerriAI/litellm","slug":"completion-response-is-not-a-dictionary-compl","errorCode":null,"errorMessage":"'completion_response' is not a dictionary - {completion_response}","messagePattern":"'completion_response' is not a dictionary - (.+?)","errorType":"exception","errorClass":"PredibaseError","httpStatus":422,"severity":"error","filePath":"litellm/llms/predibase/chat/transformation.py","lineNumber":157,"sourceCode":"    ) -> ModelResponse:\n        logging_obj.post_call(\n            input=messages,\n            api_key=api_key or \"\",\n            original_response=raw_response.text,\n            additional_args={\"complete_input_dict\": request_data},\n        )\n        try:\n            completion_response: Final = raw_response.json()\n        except Exception:\n            raise PredibaseError(message=raw_response.text, status_code=422)\n\n        if \"error\" in completion_response:\n            raise PredibaseError(\n                message=str(completion_response[\"error\"]),\n                status_code=raw_response.status_code,\n            )\n        elif not isinstance(completion_response, dict):\n            raise PredibaseError(\n                status_code=422,\n                message=f\"'completion_response' is not a dictionary - {completion_response}\",\n            )\n        elif \"generated_text\" not in completion_response:\n            raise PredibaseError(\n                status_code=422,\n                message=f\"'generated_text' is not a key response dictionary - {completion_response}\",\n            )\n\n        if len(completion_response[\"generated_text\"]) > 0:\n            model_response.choices[0].message.content = self.output_parser(completion_response[\"generated_text\"])\n\n        if \"details\" in completion_response and \"tokens\" in completion_response[\"details\"]:\n            model_response.choices[0].finish_reason = map_finish_reason(completion_response[\"details\"][\"finish_reason\"])\n            sum_logprob = 0\n            for token in completion_response[\"details\"][\"tokens\"]:\n                if token[\"logprob\"] is not None:\n                    sum_logprob += token[\"logprob\"]","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/predibase/chat/transformation.py#L139-L175","documentation":"Shape guard in the Predibase response transformation: the parsed completion_response is not a dict (e.g. a list or string), so the code cannot look up 'generated_text', and the whole payload is included in the error for inspection.","triggerScenarios":"Triggered when the Predibase completion response is not a dictionary, e.g. the API returned an unexpected payload shape.","commonSituations":"See trigger scenarios.","solutions":["Ensure the Predibase endpoint returns a JSON object; a non-dict response indicates a proxy or endpoint misconfiguration.","Verify api_base points to the correct Predibase deployment URL."],"exampleFix":"# confirm api_base returns JSON: curl the endpoint and check the payload type.","handlingStrategy":"type-guard","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-14T05:17:10.506Z"}