mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(vertex_ai/files): handle IO[bytes] content in non-JSONL file upload path
This commit is contained in:
parent
aabc8f2b32
commit
3bde9e1827
1 changed files with 3 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import io
|
||||
import json
|
||||
import os
|
||||
import time
|
||||
|
|
@ -292,6 +293,8 @@ class VertexAIFilesConfig(VertexBase, BaseFilesConfig):
|
|||
return "\n".join(json.dumps(item) for item in vertex_jsonl_content)
|
||||
elif isinstance(extracted_file_data_content, bytes):
|
||||
return extracted_file_data_content
|
||||
elif isinstance(extracted_file_data_content, io.IOBase):
|
||||
return extracted_file_data_content # type: ignore[return-value]
|
||||
else:
|
||||
raise ValueError("Unsupported file content type")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue