diff --git a/claude_bridge_glm.py b/claude_bridge_glm.py index 2216ab4..4219dfa 100644 --- a/claude_bridge_glm.py +++ b/claude_bridge_glm.py @@ -94,7 +94,7 @@ def _search_normative(query: str, top_k: int = 3) -> str: results = [] for dist, idx in zip(D[0], I[0]): - if dist < 0.5: # skip low relevance + if dist < 0.83: # e5-base scores cluster 0.79-0.89; 0.83 balances precision/recall continue m = _norm_metadata[idx] results.append(f"[{m['source']}] {m['full_text'][:500]}") @@ -245,9 +245,16 @@ async def stream_claude( work_dir = get_work_dir(username, tab_id) - # Search resources if question looks like a GESN lookup + # Search resources if question mentions works/norms/materials resource_context = "" - gesn_patterns = ["расценк", "гэсн", "норм", "28-", "01-", "единиц"] + gesn_patterns = [ + "расценк", "гэсн", "норм", "28-", "01-", "единиц", + "земляны", "бетон", "монтаж", "насыпь", "балласт", "рельс", + "стрелоч", "шпал", "щебен", "щебн", "укладк", "разборк", + "кровел", "штукатур", "гидроизоляц", "теплоизоляц", "трубопровод", + "кабел", "электромонтаж", "сантехн", "вентиляц", "благоустр", + "сварочн", "устройство", "ремонт пути", "всп", "сцб", + ] if any(p in message.lower() for p in gesn_patterns): resource_context = _search_resources(message)