Class DocTruth
java.lang.Object
ai.doctruth.DocTruth
Public entry point for the library.
var result = DocTruth.from(provider)
.extract("Extract the contract terms", Contract.class)
.withProvenance()
.run(parsedDoc);
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescription<T> ExtractionBuilder<T> Stage an extraction call: pair a free-text prompt with the target type.extractJson(String prompt, JsonSchema schema) Stage a JSON Schema-driven extraction call.static DocTruthfrom(LlmProvider provider) Begin an extraction pipeline against the given provider.
-
Method Details
-
from
Begin an extraction pipeline against the given provider.- Throws:
NullPointerException- ifprovideris null.
-
extract
Stage an extraction call: pair a free-text prompt with the target type.- Throws:
NullPointerException- ifpromptortypeis null.IllegalArgumentException- ifpromptis blank.
-
extractJson
Stage a JSON Schema-driven extraction call. Use this overload for schemas exported by another runtime such as Pydantic; the result is returned as JacksonJsonNode.- Throws:
NullPointerException- ifpromptorschemais null.IllegalArgumentException- ifpromptis blank.
-