LLM verification pass: strict prompt + self-verify each finding (llm_verify_dropped stat)

This commit is contained in:
Sadmin committed 2026-11-05 10:10:29 +03:00
1 parent c4e318b1d8
commit be6896fd22
2 files changed
+81 -4

No files matched your search

+12
View File
@@ -20,10 +20,22 @@ class H(BaseHTTPRequestHandler):
def do_POST(self):
ln = int(self.headers.get("Content-Length", 0))
req = json.loads(self.rfile.read(ln) or b"{}")
sysmsg = ""
user = ""
for m in req.get("messages", []):
if m.get("role") == "user":
user = m.get("content", "")
elif m.get("role") == "system":
sysmsg = m.get("content", "")
# режим верификатора: подтверждать/отвергать правку
if "строгий проверщик" in sysmsg:
body = {"choices": [{"message": {"role": "assistant",
"content": '{"is_error": false}'}}]}
self.send_response(200)
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(json.dumps(body).encode())
return
# блоки "Абзац N: текст"
blocks = re.findall(r"Абзац (\d+): (.*?)(?:\n\n|$)", user, re.S)
out = []