{"record":{"id":"7387d7f1b6004aef","repo":"BerriAI/litellm","slug":"bedrock-batch-embedding-requires-one-input-per-jso","errorCode":null,"errorMessage":"Bedrock batch embedding requires one input per JSONL record. Got a list with {len(raw_input)} items for model={model}; emit one JSONL line per input string instead.","messagePattern":"Bedrock batch embedding requires one input per JSONL record\\. Got a list with (.+?) items for model=(.+?); emit one JSONL line per input string instead\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":558,"sourceCode":"          - 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\n        # Catches pre-tokenized inputs (List[int] from OpenAI spec, or a\n        # single int slipping past the list-unwrap above).\n        # NOTE: bool is a subclass of int but treating True/False as a token\n        # is meaningless either way, so the broad check is fine.\n        if isinstance(candidate, (list, int)):\n            raise NotImplementedError(\n                \"Bedrock Titan v2 batch embedding does not support \"\n                \"pre-tokenized integer inputs. Pass `input` as a string \"\n                f\"(model={model}).\"\n            )","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/files/transformation.py#L540-L576","documentation":"Error \"Bedrock batch embedding requires one input per JSONL record. Got a list with {len(raw_input)} items for model={model}; emit one JSONL line per input string instead.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:558 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit one JSONL line per input string instead of a list per 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"}