diff --git a/litellm/files/main.py b/litellm/files/main.py index 7bc2c13672..9c85fa1056 100644 --- a/litellm/files/main.py +++ b/litellm/files/main.py @@ -276,7 +276,7 @@ async def afile_retrieve( extra_headers: Optional[Dict[str, str]] = None, extra_body: Optional[Dict[str, str]] = None, **kwargs, -): +) -> OpenAIFileObject: """ Async: Get file contents @@ -305,7 +305,7 @@ async def afile_retrieve( else: response = init_response - return response + return OpenAIFileObject(**response.model_dump()) except Exception as e: raise e @@ -419,6 +419,7 @@ def file_retrieve( request=httpx.Request(method="create_thread", url="https://github.com/BerriAI/litellm"), # type: ignore ), ) + return cast(FileObject, response) except Exception as e: raise e