{"record":{"id":"20f92bd8ce022d88","repo":"BerriAI/litellm","slug":"embedding-batch-record-is-missing-required-input","errorCode":null,"errorMessage":"Embedding batch record is missing required `input` field: model={model}","messagePattern":"Embedding batch record is missing required `input` field: model=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":548,"sourceCode":"    def _coerce_embedding_input_to_string(raw_input: _EmbeddingBatchInput | None, model: str = \"\") -> str:\n        \"\"\"\n        Normalize an OpenAI /v1/embeddings `input` field into the single\n        string that Bedrock Titan v2 InvokeModel expects in `inputText`.\n\n        Accepts: a string, or a single-element list containing one string.\n        Rejects (with actionable messages):\n          - None / missing -> ValueError\n          - Multi-element string lists -> ValueError, prompts caller to\n            emit one JSONL line per input\n          - Pre-tokenized inputs (List[int], List[List[int]]) -> NotImplementedError\n          - Any other type -> ValueError\n\n        Extracted so the validation can be exercised in isolation and so\n        future embedding-provider branches (Titan G1, Cohere) can reuse it\n        without duplicating the type-shaping logic.\n        \"\"\"\n        if raw_input is None:\n            raise ValueError(f\"Embedding batch record is missing required `input` field: model={model}\")\n\n        # Bedrock InvokeModel for Titan v2 takes exactly one string `inputText`\n        # per call. Pre-tokenized inputs and multi-element string lists are\n        # explicitly unsupported so callers emit one JSONL line per embedding\n        # instead of relying on us to silently fan out or concatenate.\n        if isinstance(raw_input, list):\n            if len(raw_input) == 1:\n                candidate = raw_input[0]\n            else:\n                raise ValueError(\n                    \"Bedrock batch embedding requires one input per JSONL \"\n                    \"record. Got a list with \"\n                    f\"{len(raw_input)} items for model={model}; emit one \"\n                    \"JSONL line per input string instead.\"\n                )\n        else:\n            candidate = raw_input\n","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/files/transformation.py#L530-L566","documentation":"Error \"Embedding batch record is missing required `input` field: model={model}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:548 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include an `input` field in each embedding batch record."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}