v1.0.167: fix grouping dead code (classified→docs) + max_tokens 500→1000

This commit is contained in:
2026-06-24 09:35:42 +04:00
parent 49c472b46d
commit 115e71b2a1
5 changed files with 27 additions and 5 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ def _call_llm_classify(header_text):
payload = {
"model": LLM_MODEL,
"messages": [{"role": "user", "content": prompt}],
"max_tokens": 500, # классификация укладывается в ~100 токенов ответа
"max_tokens": 1000, # достаточно для JSON с длинными названиями
"temperature": 0.1, # минимальная температура для детерминированности
}
with httpx.Client(http2=True, timeout=60, verify=False) as client:
+3 -3
View File
@@ -79,9 +79,9 @@ def group_documents(batch_id):
groups.append(group)
# Unmatched documents → "unresolved" group
# Unmatched documents → "unresolved" group (including failed/pending)
unmatched = [s for s in supplements_list if s.get("doc_type") != "contract"]
unmatched += [d for d in classified if d.get("classify_status") != "classified"]
unmatched += [d for d in docs if d.get("classify_status") != "classified"]
if unmatched or len(contracts_list) == 0:
# Put unmatched into a separate group
@@ -92,7 +92,7 @@ def group_documents(batch_id):
"documents": unmatched,
})
return {"ok": True, "groups": groups, "total_docs": len(classified)}
return {"ok": True, "groups": groups, "total_docs": len(docs)}
def apply_groups(batch_id, groups_data):