v3.11.11: fix UnboundLocalError last_role in Gemini sanitizer

This commit is contained in:
Roman | RyzenAdvanced
2026-05-26 22:09:46 +04:00
Unverified
parent 01080fd30f
commit ff849e8669
2 changed files with 1 additions and 0 deletions

View File

@@ -5574,6 +5574,7 @@ class Handler(http.server.BaseHTTPRequestHandler):
if OAUTH_PROVIDER.startswith("google") and "claude" not in model.lower():
sanitized = []
last_user_text = None
last_role = None
for content in contents:
role = content.get("role")
parts = [p for p in content.get("parts", []) if isinstance(p, dict)]