mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
fix(bedrock/files): handle IO[bytes] content in non-JSONL upload path
This commit is contained in:
parent
f3b53e3339
commit
7dbf105e13
1 changed files with 6 additions and 0 deletions
|
|
@ -390,6 +390,12 @@ class BedrockFilesConfig(BaseAWSLLM, BaseFilesConfig):
|
|||
file_content = extracted_file_data_content.decode("utf-8")
|
||||
elif isinstance(extracted_file_data_content, str):
|
||||
file_content = extracted_file_data_content
|
||||
elif hasattr(extracted_file_data_content, "read") and hasattr(
|
||||
extracted_file_data_content, "seek"
|
||||
):
|
||||
# IO[bytes] path (e.g. SpooledTemporaryFile from FastAPI UploadFile)
|
||||
extracted_file_data_content.seek(0)
|
||||
file_content = extracted_file_data_content.read().decode("utf-8")
|
||||
else:
|
||||
raise ValueError("Unsupported file content type")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue