From 46084fccd2f67a8adf26c4c19415d4091c2d8efa Mon Sep 17 00:00:00 2001 From: Josephasafg Date: Thu, 26 Sep 2024 15:21:18 +0300 Subject: [PATCH] fix: Removed unnecessary urls --- ai21/clients/studio/client_url_parser.py | 7 +------ examples/studio/async_library.py | 3 --- examples/studio/library.py | 3 --- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/ai21/clients/studio/client_url_parser.py b/ai21/clients/studio/client_url_parser.py index 921e3c1a..023bac0b 100644 --- a/ai21/clients/studio/client_url_parser.py +++ b/ai21/clients/studio/client_url_parser.py @@ -1,10 +1,5 @@ -from ai21.constants import STUDIO_HOST - - def create_client_url(base_url: str) -> str: - allowed_urls = ["https://api-stage.ai21.com", STUDIO_HOST] - - if base_url in allowed_urls: + if base_url.endswith(".ai21.com"): return f"{base_url}/studio/v1" return base_url diff --git a/examples/studio/async_library.py b/examples/studio/async_library.py index 0af618f8..22b5941c 100644 --- a/examples/studio/async_library.py +++ b/examples/studio/async_library.py @@ -5,9 +5,6 @@ import file_utils from ai21 import AsyncAI21Client, AI21APIError -# Use api_host for testing staging, default is production -# os.environ["AI21_API_HOST"] = "https://api-stage.ai21.com" - client = AsyncAI21Client() diff --git a/examples/studio/library.py b/examples/studio/library.py index 0ec21c95..7441a793 100644 --- a/examples/studio/library.py +++ b/examples/studio/library.py @@ -4,9 +4,6 @@ import file_utils from ai21 import AI21Client, AI21APIError -# Use api_host for testing staging, default is production -# os.environ["AI21_API_HOST"] = "https://api-stage.ai21.com" - client = AI21Client()