update db fix

This commit is contained in:
nikolay
2026-05-06 16:42:03 +03:00
parent 0f2ea42ee6
commit 1a78de96b9
3 changed files with 18 additions and 2 deletions
+4
View File
@@ -224,6 +224,8 @@ def _required_str(payload: Dict[str, Any], key: str) -> Tuple[Optional[str], Opt
app = Flask(__name__, static_folder=".", static_url_path="")
# Accept both `/path` and `/path/` to be resilient behind proxies/CDNs.
app.url_map.strict_slashes = False
def _db_connect() -> sqlite3.Connection:
@@ -510,6 +512,7 @@ def discover_models(provider: str) -> list:
@app.get("/api/chat")
@app.get("/api/chat/")
def api_chat_list() -> Any:
provider = request.args.get("provider", "").strip()
if not provider:
@@ -580,6 +583,7 @@ def api_chat_list() -> Any:
@app.post("/api/chat/clear")
@app.post("/api/chat/clear/")
def api_chat_clear() -> Any:
payload = request.get_json(silent=True) or {}
provider, err = _required_str(payload, "provider")