diff --git a/src/fastapi_poe/base.py b/src/fastapi_poe/base.py index 6c1be3b..67457d0 100644 --- a/src/fastapi_poe/base.py +++ b/src/fastapi_poe/base.py @@ -33,6 +33,7 @@ URL_ATTACHMENT_TEMPLATE, ) from fastapi_poe.types import ( + Attachment, AttachmentUploadResponse, ContentType, CostItem, @@ -420,7 +421,7 @@ async def post_message_attachment( stacklevel=2, ) - attachment = await upload_file( + attachment = await self._upload_file( file=file_data, file_url=download_url, file_name=filename or download_filename, @@ -446,6 +447,23 @@ async def post_message_attachment( inline_ref=inline_ref, ) + async def _upload_file( + self, + *, + file: Optional[Union[bytes, BinaryIO]], + file_url: Optional[str], + file_name: Optional[str], + api_key: str, + base_url: str, + ) -> Attachment: + return await upload_file( + file=file, + file_url=file_url, + file_name=file_name, + api_key=api_key, + base_url=base_url, + ) + @deprecated( "This method is deprecated. Use `insert_attachment_messages` instead." "This method will be removed in a future release."