Skip to content

Commit f661dc1

Browse files
committed
fix: streamline Azure OpenAI endpoint check by removing unnecessary local import
1 parent 1370c2a commit f661dc1

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

pipelines/azure/azure_ai_foundry.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,11 @@ def _extract_model_from_url(self) -> Optional[str]:
214214
return None
215215

216216
try:
217-
# Check if this is an Azure OpenAI URL
218-
from urllib.parse import urlparse # Local import to avoid scope issues
219217
endpoint_host = urlparse(self.valves.AZURE_AI_ENDPOINT).hostname or ""
220218
if (
221-
(endpoint_host == "openai.azure.com" or endpoint_host.endswith(".openai.azure.com"))
222-
and "/deployments/" in self.valves.AZURE_AI_ENDPOINT
223-
):
219+
endpoint_host == "openai.azure.com"
220+
or endpoint_host.endswith(".openai.azure.com")
221+
) and "/deployments/" in self.valves.AZURE_AI_ENDPOINT:
224222
# Extract model name from URL pattern
225223
# Pattern: .../deployments/{model}/chat/completions...
226224
parts = self.valves.AZURE_AI_ENDPOINT.split("/deployments/")

0 commit comments

Comments
 (0)