Spaces:
Running
Running
| from app.core.quality import is_low_trust | |
| def test_low_trust_when_citation_coverage_is_too_low() -> None: | |
| answer = ( | |
| "He worked at Xsilica and built payment-testing workflows. " | |
| "The role improved throughput and reduced defects [1]. " | |
| "He also collaborated across release cycles with API testing." | |
| ) | |
| chunks = [{"text": "resume evidence", "metadata": {}}] | |
| assert is_low_trust(answer, chunks, complexity="simple") is True | |
| def test_not_low_trust_when_most_fact_sentences_are_cited() -> None: | |
| answer = ( | |
| "He worked at Xsilica as a QA intern [1]. " | |
| "The role increased throughput under load tests [1]. " | |
| "It also reduced post-release defects across releases [1]." | |
| ) | |
| chunks = [{"text": "resume evidence", "metadata": {}}] | |
| assert is_low_trust(answer, chunks, complexity="simple") is False | |