File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 URL_ATTACHMENT_TEMPLATE ,
3434)
3535from fastapi_poe .types import (
36+ Attachment ,
3637 AttachmentUploadResponse ,
3738 ContentType ,
3839 CostItem ,
@@ -420,7 +421,7 @@ async def post_message_attachment(
420421 stacklevel = 2 ,
421422 )
422423
423- attachment = await upload_file (
424+ attachment = await self . _upload_file (
424425 file = file_data ,
425426 file_url = download_url ,
426427 file_name = filename or download_filename ,
@@ -446,6 +447,23 @@ async def post_message_attachment(
446447 inline_ref = inline_ref ,
447448 )
448449
450+ async def _upload_file (
451+ self ,
452+ * ,
453+ file : Optional [Union [bytes , BinaryIO ]],
454+ file_url : Optional [str ],
455+ file_name : Optional [str ],
456+ api_key : str ,
457+ base_url : str ,
458+ ) -> Attachment :
459+ return await upload_file (
460+ file = file ,
461+ file_url = file_url ,
462+ file_name = file_name ,
463+ api_key = api_key ,
464+ base_url = base_url ,
465+ )
466+
449467 @deprecated (
450468 "This method is deprecated. Use `insert_attachment_messages` instead."
451469 "This method will be removed in a future release."
You can’t perform that action at this time.
0 commit comments