{"record":{"id":"1da4ed900aebba40","repo":"BerriAI/litellm","slug":"nested-combined-embeddings-are-not-supported-on","errorCode":null,"errorMessage":"Nested (combined) embeddings are not supported on the embedContent path. Use the batchEmbedContents path or pass a flat list instead.","messagePattern":"Nested \\(combined\\) embeddings are not supported on the embedContent path\\. Use the batchEmbedContents path or pass a flat list instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py","lineNumber":284,"sourceCode":"    Args:\n        input: GeminiEmbeddingInput with text, data URIs, or file references\n        model: Model name\n        optional_params: Additional parameters (taskType, outputDimensionality, etc.)\n        resolved_files: Dict mapping file names (files/abc) to {mime_type, uri}\n\n    Returns:\n        dict: Gemini embedContent request body with content.parts\n    \"\"\"\n    resolved_files = resolved_files or {}\n\n    gemini_params: Final = _filter_embed_params(optional_params)\n\n    input_list: Final = [input] if isinstance(input, str) else input\n    parts: Final[list[PartType]] = []\n\n    for element in input_list:\n        if isinstance(element, list):\n            raise ValueError(\n                \"Nested (combined) embeddings are not supported on the embedContent path. \"\n                \"Use the batchEmbedContents path or pass a flat list instead.\"\n            )\n        if not isinstance(element, str):\n            raise ValueError(f\"Unsupported input type: {type(element)}\")\n        parts.append(_build_part_for_input(element, resolved_files=resolved_files))\n\n    request_body: Final[dict] = {\n        \"content\": ContentType(parts=parts),\n        **gemini_params,\n    }\n\n    return request_body\n\n\n_IMAGE_MIME_TYPES: Final = frozenset({\"image/png\", \"image/jpeg\"})\n_VIDEO_TOKENS_PER_SECOND: Final = 258.0\n_AUDIO_TOKENS_PER_SECOND: Final = 32.0","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py#L266-L302","documentation":"Gemini embedContent path guard: the input contains a nested list (combined multimodal embedding), which only the batchEmbedContents endpoint supports; the single-request embedContent path rejects it and points to the batch API.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:284 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Flatten the nested input into a single flat list of strings/images before calling embedContent.","Alternatively use the batchEmbedContents path (async batch embedding) which supports combined/nested inputs."],"exampleFix":null,"handlingStrategy":"validation","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"}