Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: code scanning alerts (#3689)

Dylan Madisetti58098bcbf2de
diff --git a/marimo/_ai/llm.py b/marimo/_ai/llm.py
index f10b947bcc..5371676d02 100644
--- a/marimo/_ai/llm.py
+++ b/marimo/_ai/llm.py
@@ -119,7 +119,7 @@ class openai(ChatModel):
# https://[subdomain].openai.azure.com/openai/deployments/[model]/chat/completions?api-version=[api_version]
parsed_url = urlparse(self.base_url)
if parsed_url.hostname and cast(str, parsed_url.hostname).endswith(
- "openai.azure.com"
+ ".openai.azure.com"
):
self.model = cast(str, parsed_url.path).split("/")[3]
api_version = parse_qs(cast(str, parsed_url.query))["api-version"][
diff --git a/marimo/_server/api/endpoints/ai.py b/marimo/_server/api/endpoints/ai.py
index 56e2fec24a..e7278eb19e 100644
--- a/marimo/_server/api/endpoints/ai.py
+++ b/marimo/_server/api/endpoints/ai.py
@@ -99,7 +99,7 @@ def get_openai_client(config: MarimoConfig) -> "OpenAI":
# https://[subdomain].openai.azure.com/openai/deployments/[model]/chat/completions?api-version=[api_version]
parsed_url = urlparse(base_url)
if parsed_url.hostname and cast(str, parsed_url.hostname).endswith(
- "openai.azure.com"
+ ".openai.azure.com"
):
deployment_model = cast(str, parsed_url.path).split("/")[3]
api_version = parse_qs(cast(str, parsed_url.query))["api-version"][0]