{"record":{"id":"f10dc493971ad042","repo":"BerriAI/litellm","slug":"unsupported-file-content-type","errorCode":null,"errorMessage":"Unsupported file content type","messagePattern":"Unsupported file content type","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/bedrock/files/transformation.py","lineNumber":893,"sourceCode":"        if FilesAPIUtils.is_batch_jsonl_file(\n            create_file_data=create_file_data,\n            extracted_file_data=extracted_file_data,\n        ):\n            ## Transform JSONL content to Bedrock format\n            original_file_content: Final = self._get_content_from_openai_file(extracted_file_data_content)\n            openai_jsonl_content = [json.loads(line) for line in original_file_content.splitlines() if line.strip()]\n            litellm_params_model: Final = litellm_params.get(\"model\")\n            target_model: Final = model or (litellm_params_model if isinstance(litellm_params_model, str) else \"\")\n            bedrock_jsonl_content = self._transform_openai_jsonl_content_to_bedrock_jsonl_content(\n                openai_jsonl_content, target_model=target_model\n            )\n            file_content = \"\\n\".join(json.dumps(item) for item in bedrock_jsonl_content)\n        elif isinstance(extracted_file_data_content, bytes):\n            file_content = extracted_file_data_content.decode(\"utf-8\")\n        elif isinstance(extracted_file_data_content, str):\n            file_content = extracted_file_data_content\n        else:\n            raise ValueError(\"Unsupported file content type\")\n\n        # Get the S3 URL for upload\n        api_base: Final = self.get_complete_file_url(\n            api_base=None,\n            api_key=None,\n            model=model,\n            optional_params=optional_params,\n            litellm_params=litellm_params,\n            data=create_file_data,\n        )\n\n        # s3_region_name always wins for S3 operations (same priority as in\n        # get_complete_file_url above). Overwrite aws_region_name unconditionally,\n        # after the deployment-credential merge, so the SigV4 region matches the\n        # URL region, avoiding SignatureDoesNotMatch.\n        merged_params: Final = merge_bedrock_aws_request_params(litellm_params, optional_params)\n        s3_region_name: Final = litellm_params.get(\"s3_region_name\") or optional_params.get(\"s3_region_name\")\n        request_params: Final = (","sourceCodeStart":875,"sourceCodeEnd":911,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/bedrock/files/transformation.py#L875-L911","documentation":"Error \"Unsupported file content type\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/bedrock/files/transformation.py:893 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass file content as a supported type (bytes or file-like object)."],"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"}