update db fix
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user