{"record":{"id":"7547ec979161289c","repo":"BerriAI/litellm","slug":"embedcontent-response-missing-embedding-field","errorCode":null,"errorMessage":"embedContent response missing 'embedding' field: {response_json}","messagePattern":"embedContent response missing 'embedding' field: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py","lineNumber":425,"sourceCode":"    response_json: dict,\n    resolved_files: Mapping[str, Mapping[str, str]] | None = None,\n) -> EmbeddingResponse:\n    \"\"\"\n    Process Gemini embedContent response (single embedding for multimodal input).\n\n    Args:\n        input: Original input\n        model_response: EmbeddingResponse to populate\n        model: Model name\n        response_json: Raw JSON response from embedContent endpoint\n        resolved_files: Mapping of file references (files/abc) to {mime_type, uri},\n            used to bill resolved image references at the per-image rate\n\n    Returns:\n        EmbeddingResponse with single embedding\n    \"\"\"\n    if \"embedding\" not in response_json:\n        raise ValueError(f\"embedContent response missing 'embedding' field: {response_json}\")\n\n    embedding_data: Final = response_json[\"embedding\"]\n\n    openai_embedding: Final = Embedding(\n        embedding=embedding_data[\"values\"],\n        index=0,\n        object=\"embedding\",\n    )\n\n    model_response.data = [openai_embedding]\n    model_response.model = model\n    model_response.usage = _usage_from_embed_content_response(\n        input=input,\n        model=model,\n        raw_usage_metadata=response_json.get(\"usageMetadata\"),\n        resolved_files=resolved_files or {},\n    )\n","sourceCodeStart":407,"sourceCodeEnd":443,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py#L407-L443","documentation":"Gemini embedContent response guard: the parsed response JSON lacks the required 'embedding' field, so no vector can be extracted; the full response JSON is echoed to diagnose the unexpected provider payload.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:425 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the raw response_json in the error for an upstream error message or a changed response schema.","Retry the request; if it persists, verify the model name and that the embedContent endpoint returned a successful status."],"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-14T05:17:10.506Z"}