Compare commits

...

3 Commits

Author SHA1 Message Date
Greyson LaLonde
e7976565e5 Merge branch 'main' into alert-autofix-26 2025-11-24 12:11:15 -05:00
Greyson LaLonde
a60bb90d6a Merge branch 'main' into alert-autofix-26 2025-11-18 12:13:34 -05:00
Rip&Tear
f557334c01 Potential fix for code scanning alert no. 26: Incomplete URL substring sanitization
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-11-08 21:31:40 +08:00

View File

@@ -4,7 +4,7 @@ import json
import logging
import os
from typing import TYPE_CHECKING, Any
from urllib.parse import urlparse
from pydantic import BaseModel
from crewai.utilities.agent_utils import is_context_length_exceeded
@@ -143,8 +143,10 @@ class AzureCompletion(BaseLLM):
prefix in model.lower() for prefix in ["gpt-", "o1-", "text-"]
)
parsed_endpoint = urlparse(self.endpoint)
host = parsed_endpoint.hostname or ""
self.is_azure_openai_endpoint = (
"openai.azure.com" in self.endpoint
(host == "openai.azure.com" or host.endswith(".openai.azure.com"))
and "/openai/deployments/" in self.endpoint
)