Agent Zero AI framework
ignore typecheck in models.py
frdel9c75aea346cb
diff --git a/models.py b/models.pyindex 924415c7f..12c36afb4 100644--- a/models.py+++ b/models.py@@ -17,6 +17,7 @@ from typing import (from litellm import completion, acompletion, embeddingimport litellmimport openai+from litellm.types.utils import ModelResponsefrom python.helpers import dotenvfrom python.helpers import settings, dirty_json@@ -620,9 +621,9 @@ class BrowserCompatibleChatWrapper(ChatOpenRouter):# Gemini: strip triple backticks and conform schematry:- msg = resp.choices[0].message+ msg = resp.choices[0].message # type: ignoreif self.provider == "gemini" and isinstance(getattr(msg, "content", None), str):- cleaned = browser_use_monkeypatch.gemini_clean_and_conform(msg.content)+ cleaned = browser_use_monkeypatch.gemini_clean_and_conform(msg.content) # type: ignoreif cleaned:msg.content = cleanedexcept Exception:diff --git a/webui/js/api.js b/webui/js/api.jsindex eeec492b5..2baa1eb9a 100644--- a/webui/js/api.js+++ b/webui/js/api.js@@ -55,6 +55,7 @@ export async function fetchApi(url, request) {}else if(response.redirected && response.url.endsWith("/login")){// redirect to loginwindow.location.href = response.url;+ return;}// return the response@@ -80,8 +81,14 @@ async function getCsrfToken() {if (csrfToken) return csrfToken;const response = await fetch("/csrf_token", {credentials: "same-origin",- }).then((r) => r.json());- csrfToken = response.token;- document.cookie = `csrf_token_${response.runtime_id}=${csrfToken}; SameSite=Strict; Path=/`;+ });+ if (response.redirected && response.url.endsWith("/login")) {+ // redirect to login+ window.location.href = response.url;+ return;+ }+ const json = await response.json();+ csrfToken = json.token;+ document.cookie = `csrf_token_${json.runtime_id}=${csrfToken}; SameSite=Strict; Path=/`;return csrfToken;}