From f38f5377ffed1a30930c954f181a1fcca7347a24 Mon Sep 17 00:00:00 2001 From: yanalialiuk Date: Fri, 29 May 2026 19:52:11 +0300 Subject: [PATCH] docs: add fact_check docstring and DEFAULT_TOP_K constant Co-authored-by: Cursor --- fact_check.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fact_check.py b/fact_check.py index cb00a49..4941e56 100644 --- a/fact_check.py +++ b/fact_check.py @@ -3,6 +3,7 @@ from llama_cpp import Llama import torch +DEFAULT_TOP_K = 3 embedder = SentenceTransformer("all-MiniLM-L6-v2") @@ -19,8 +20,8 @@ -# Функция проверки факта -def fact_check(query: str, top_k: int = 3) -> str: +def fact_check(query: str, top_k: int = DEFAULT_TOP_K) -> str: + """Проверяет утверждение по базе Chroma и возвращает краткий вердикт LLM.""" # embedding запроса with torch.no_grad():