Adapters
Adapters are concrete implementations of the protocol interfaces. They wrap existing chains and tools from the codebase into the pluggable workflow system.
Extractors
Claim extraction strategies implement the ClaimExtractor protocol.
SimpleExtractor
truthfulness_evaluator.strategies.extractors.SimpleExtractor
Adapter for SimpleClaimExtractionChain satisfying ClaimExtractor protocol.
Source code in src/truthfulness_evaluator/strategies/extractors/simple.py
extract(document, source_path, *, max_claims=None)
async
Extract claims using simple LLM-based extraction.
Source code in src/truthfulness_evaluator/strategies/extractors/simple.py
TripletExtractor
truthfulness_evaluator.strategies.extractors.TripletExtractor
Adapter for TripletExtractionChain satisfying ClaimExtractor protocol.
Source code in src/truthfulness_evaluator/strategies/extractors/triplet.py
extract(document, source_path, *, max_claims=None)
async
Extract claims as subject-relation-object triplets.
Source code in src/truthfulness_evaluator/strategies/extractors/triplet.py
Gatherers
Evidence gathering strategies implement the EvidenceGatherer protocol.
WebSearchGatherer
truthfulness_evaluator.strategies.gatherers.WebSearchGatherer
Adapter wrapping WebEvidenceGatherer for the EvidenceGatherer protocol.
Source code in src/truthfulness_evaluator/strategies/gatherers/web.py
__init__(max_results=3)
Initialize web search gatherer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_results |
int
|
Maximum number of search results to gather |
3
|
Source code in src/truthfulness_evaluator/strategies/gatherers/web.py
gather(claim, context)
async
Gather web evidence for a claim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
claim |
Claim
|
The claim to find evidence for |
required |
context |
dict[str, Any]
|
Workflow context (unused by web search) |
required |
Returns:
| Type | Description |
|---|---|
list[Evidence]
|
List of Evidence objects from web sources |
Source code in src/truthfulness_evaluator/strategies/gatherers/web.py
FilesystemGatherer
truthfulness_evaluator.strategies.gatherers.FilesystemGatherer
Adapter wrapping FilesystemEvidenceAgent for the EvidenceGatherer protocol.
Source code in src/truthfulness_evaluator/strategies/gatherers/filesystem.py
__init__(model='gpt-4o')
Initialize filesystem gatherer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model |
str
|
LLM model name for ReAct agent |
'gpt-4o'
|
gather(claim, context)
async
Gather filesystem evidence for a claim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
claim |
Claim
|
The claim to find evidence for |
required |
context |
dict[str, Any]
|
Workflow context containing root_path |
required |
Returns:
| Type | Description |
|---|---|
list[Evidence]
|
List of Evidence objects from filesystem sources |
Source code in src/truthfulness_evaluator/strategies/gatherers/filesystem.py
CompositeGatherer
truthfulness_evaluator.strategies.gatherers.CompositeGatherer
Runs multiple evidence gatherers in parallel and combines results.
Source code in src/truthfulness_evaluator/strategies/gatherers/composite.py
__init__(gatherers, *, max_total_evidence=10, deduplicate=True)
Initialize composite gatherer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gatherers |
list[EvidenceGatherer]
|
List of gatherer instances to run in parallel |
required |
max_total_evidence |
int
|
Maximum total evidence items to return |
10
|
deduplicate |
bool
|
Whether to remove duplicate evidence by source |
True
|
Source code in src/truthfulness_evaluator/strategies/gatherers/composite.py
gather(claim, context)
async
Gather evidence from all configured gatherers in parallel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
claim |
Claim
|
The claim to find evidence for |
required |
context |
dict[str, Any]
|
Workflow context passed to all gatherers |
required |
Returns:
| Type | Description |
|---|---|
list[Evidence]
|
Combined, deduplicated, and sorted evidence list |
Source code in src/truthfulness_evaluator/strategies/gatherers/composite.py
Verifiers
Claim verification strategies implement the ClaimVerifier protocol.
SingleModelVerifier
truthfulness_evaluator.strategies.verifiers.SingleModelVerifier
Adapter for single-model claim verification using VerificationChain.
Source code in src/truthfulness_evaluator/strategies/verifiers/single_model.py
verify(claim, evidence)
async
Verify a claim against evidence using a single LLM.
ConsensusVerifier
truthfulness_evaluator.strategies.verifiers.ConsensusVerifier
Adapter for multi-model consensus verification using ConsensusChain.
Source code in src/truthfulness_evaluator/strategies/verifiers/consensus.py
verify(claim, evidence)
async
Verify a claim using multi-model consensus.
ICE Consensus Status
The iterative critique/revise rounds for ICE (Iterative Consensus Ensemble) are currently stubbed. The implementation uses weighted voting but does not yet perform full debate-style refinement.
InternalVerifier
truthfulness_evaluator.strategies.verifiers.InternalVerifier
Adapter for internal/codebase verification using InternalVerificationChain.
Source code in src/truthfulness_evaluator/strategies/verifiers/internal.py
verify(claim, evidence)
async
Verify a claim against the codebase after classifying it.
Source code in src/truthfulness_evaluator/strategies/verifiers/internal.py
Formatters
Report formatting strategies implement the ReportFormatter protocol.
JsonFormatter
truthfulness_evaluator.strategies.formatters.JsonFormatter
Formats truthfulness reports as JSON.
Source code in src/truthfulness_evaluator/strategies/formatters/json_fmt.py
file_extension()
MarkdownFormatter
truthfulness_evaluator.strategies.formatters.MarkdownFormatter
Formats truthfulness reports as Markdown.
Source code in src/truthfulness_evaluator/strategies/formatters/markdown.py
file_extension()
format(report)
Format a truthfulness report as Markdown.
HtmlFormatter
truthfulness_evaluator.strategies.formatters.HtmlFormatter
Formats truthfulness reports as HTML.
Source code in src/truthfulness_evaluator/strategies/formatters/html.py
file_extension()
format(report)
Format a truthfulness report as HTML.