From b2bbec2d7ec291777030414cf35578e1a99fb473 Mon Sep 17 00:00:00 2001 From: Kris Yang <145800990+krisyang1125@users.noreply.github.com> Date: Wed, 15 Jan 2025 17:04:28 -0800 Subject: [PATCH] Add const for poe_api base url --- src/fastapi_poe/base.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fastapi_poe/base.py b/src/fastapi_poe/base.py index af4e9d7..5bddfce 100644 --- a/src/fastapi_poe/base.py +++ b/src/fastapi_poe/base.py @@ -48,6 +48,7 @@ ) logger = logging.getLogger("uvicorn.default") +POE_API_WEBSERVER_BASE_URL = "https://www.quora.com/poe_api/" class InvalidParameterError(Exception): @@ -322,7 +323,7 @@ async def post_message_attachment( filename: Optional[str] = None, content_type: Optional[str] = None, is_inline: bool = False, - base_url: str = "https://www.quora.com/poe_api/", + base_url: str = POE_API_WEBSERVER_BASE_URL, ) -> AttachmentUploadResponse: ... # This overload requires all parameters to be passed as keywords @@ -337,7 +338,7 @@ async def post_message_attachment( filename: Optional[str] = None, content_type: Optional[str] = None, is_inline: bool = False, - base_url: str = "https://www.quora.com/poe_api/", + base_url: str = POE_API_WEBSERVER_BASE_URL, ) -> AttachmentUploadResponse: ... async def post_message_attachment( @@ -351,7 +352,7 @@ async def post_message_attachment( filename: Optional[str] = None, content_type: Optional[str] = None, is_inline: bool = False, - base_url: str = "https://www.quora.com/poe_api/", + base_url: str = POE_API_WEBSERVER_BASE_URL, ) -> AttachmentUploadResponse: """ @@ -413,7 +414,7 @@ async def _make_file_attachment_request( filename: Optional[str] = None, content_type: Optional[str] = None, is_inline: bool = False, - base_url: str = "https://www.quora.com/poe_api/", + base_url: str = POE_API_WEBSERVER_BASE_URL, ) -> AttachmentUploadResponse: if self.access_key: if access_key: