{"record":{"id":"22846410dd2b788c","repo":"BerriAI/litellm","slug":"no-response-received-original-response-respons","errorCode":null,"errorMessage":"No response received. Original response - {response}","messagePattern":"No response received\\. Original response - (.+?)","errorType":"exception","errorClass":"PalmError","httpStatus":400,"severity":"error","filePath":"litellm/llms/deprecated_providers/palm.py","lineNumber":172,"sourceCode":"    ## RESPONSE OBJECT\n    completion_response = response\n    try:\n        choices_list: Final = []\n        for idx, item in enumerate(completion_response.candidates):\n            if len(item[\"output\"]) > 0:\n                message_obj = Message(content=item[\"output\"])\n            else:\n                message_obj = Message(content=None)\n            choice_obj = Choices(index=idx + 1, message=message_obj)\n            choices_list.append(choice_obj)\n        model_response.choices = choices_list\n    except Exception:\n        raise PalmError(message=traceback.format_exc(), status_code=response.status_code)\n\n    try:\n        completion_response = model_response[\"choices\"][0][\"message\"].get(\"content\")\n    except Exception:\n        raise PalmError(\n            status_code=400,\n            message=f\"No response received. Original response - {response}\",\n        )\n\n    ## CALCULATING USAGE - baseten charges on time, not tokens - have some mapping of cost here.\n    prompt_tokens: Final = len(encoding.encode(prompt))\n    completion_tokens: Final = len(encoding.encode(model_response[\"choices\"][0][\"message\"].get(\"content\", \"\")))\n\n    model_response.created = int(time.time())\n    model_response.model = \"palm/\" + model\n    usage: Final = Usage(\n        prompt_tokens=prompt_tokens,\n        completion_tokens=completion_tokens,\n        total_tokens=prompt_tokens + completion_tokens,\n    )\n    setattr(model_response, \"usage\", usage)\n    return model_response\n","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/deprecated_providers/palm.py#L154-L190","documentation":"Response guard in deprecated PaLM completion: the response object carries no usable candidates/output, so there is no content to map into ModelResponse. The original response is included verbatim so the caller can inspect what PaLM returned.","triggerScenarios":"Thrown at litellm/llms/deprecated_providers/palm.py:172 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The palm API returned an empty response; check request parameters and the original response in the error.","Migrate to the gemini provider, since palm is deprecated."],"exampleFix":null,"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-23T08:17:48.524Z"}