Files
FusionAGI/fusionagi/verification/contradiction.py
defiQUG c052b07662
Some checks failed
Tests / test (3.10) (push) Has been cancelled
Tests / test (3.11) (push) Has been cancelled
Tests / test (3.12) (push) Has been cancelled
Tests / lint (push) Has been cancelled
Tests / docker (push) Has been cancelled
Initial commit: add .gitignore and README
2026-02-09 21:51:42 -08:00

22 lines
720 B
Python

from typing import Any, Protocol
class SemanticLike(Protocol):
def query(self, domain, limit): ...
class ContradictionDetector:
def __init__(self, semantic=None):
self._semantic = semantic
def check(self, claim, context=None):
out = []
if not claim or not claim.strip():
return out
ctx = context or {}
domain = ctx.get("domain", "")
if self._semantic:
facts = self._semantic.query(domain or None, 50)
for f in facts:
st = f.get("statement", "")
if st and "not " in claim.lower() and st.lower() in claim.lower():
out.append("Contradicts: " + st[:100])
return out