{"record":{"id":"db31362c4fe4138f","repo":"BerriAI/litellm","slug":"file-reference-element-not-resolved","errorCode":null,"errorMessage":"File reference {element} not resolved","messagePattern":"File reference (.+?) not resolved","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py","lineNumber":185,"sourceCode":"    Build a single PartType for an input element, handling text, data URIs,\n    file references, and GCS URLs.\n    \"\"\"\n    resolved_files = resolved_files or {}\n\n    if element.startswith(\"data:\") and \";base64,\" in element:\n        mime_type, base64_data = _parse_data_url(element)\n        blob: Final[BlobType] = {\"mime_type\": mime_type, \"data\": base64_data}\n        return PartType(inline_data=blob)\n    elif _is_gcs_url(element):\n        mime_type = _infer_mime_type_from_gcs_url(element)\n        file_data: Final[FileDataType] = {\n            \"mime_type\": mime_type,\n            \"file_uri\": element,\n        }\n        return PartType(file_data=file_data)\n    elif _is_file_reference(element):\n        if element not in resolved_files:\n            raise ValueError(f\"File reference {element} not resolved\")\n        file_info: Final = resolved_files[element]\n        file_data_ref: Final[FileDataType] = {\n            \"mime_type\": file_info[\"mime_type\"],\n            \"file_uri\": file_info[\"uri\"],\n        }\n        return PartType(file_data=file_data_ref)\n    else:\n        return PartType(text=element)\n\n\n_SUPPORTED_EMBED_PARAMS: Final = {\"outputDimensionality\", \"taskType\", \"title\"}\n\n\ndef _filter_embed_params(optional_params: dict) -> dict:\n    \"\"\"Map and filter optional_params to only include Gemini embedding fields.\"\"\"\n    gemini_params: Final = optional_params.copy()\n    if \"dimensions\" in gemini_params:\n        gemini_params[\"outputDimensionality\"] = gemini_params.pop(\"dimensions\")","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py#L167-L203","documentation":"Gemini embedding part-builder guard: the input element is a files/... reference that was never resolved into {mime_type, uri} by the pre-flight resolution step (missing from resolved_files), so its fileData part cannot be built.","triggerScenarios":"Thrown at litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every file reference in the input is included in the file_data / resolved files mapping passed with the request.","Check for typos in the reference key and confirm the referenced file was uploaded or provided before calling the embedding API."],"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"}