{"record":{"id":"299e89c91c517280","repo":"BerriAI/litellm","slug":"str-completion-response-error","errorCode":null,"errorMessage":"str(completion_response[\"error\"])","messagePattern":"str\\(completion_response\\[\"error\"\\]\\)","errorType":"http","errorClass":"PredibaseError","httpStatus":null,"severity":"error","filePath":"litellm/llms/predibase/chat/transformation.py","lineNumber":152,"sourceCode":"        optional_params: dict,\n        litellm_params: dict,\n        encoding: Any,\n        api_key: str | None = None,\n        json_mode: bool | None = None,\n    ) -> 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\"]:","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/predibase/chat/transformation.py#L134-L170","documentation":"Upstream error propagation in the Predibase transformation: the parsed JSON body contains an 'error' key, and its stringified value is raised as a PredibaseError with the HTTP status, surfacing Predibase's own error payload.","triggerScenarios":"Triggered when the Predibase completion response dictionary contains an 'error' key.","commonSituations":"See trigger scenarios.","solutions":["The Predibase completion returned an 'error' field; inspect completion_response[\"error\"] for details.","Check that the model/deployment name and prompt are valid for your Predibase tenant."],"exampleFix":"# adjust request based on the error string returned in the completion response.","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-14T00:17:10.932Z"}