Class SchemaDescriber

java.lang.Object
dyntabs.ai.extract.SchemaDescriber

public final class SchemaDescriber extends Object
Turns a Java type into a human-readable JSON "skeleton" that tells an LLM exactly which fields to produce and of what type.

Analogy: this is the fill-in-the-blank form generator. Given a class such as Invoice(String vendor, BigDecimal total, List<LineItem> items) it prints a blank form like:

 {
   "vendor": "string",
   "total": "number",
   "items": [ { "description": "string", "amount": "number" } ]
 }
 

The model then "fills in the blanks" with values from the source text, and ExtractionEngine parses the filled form back into a real instance.

Supports Java records and plain POJOs (described by their declared fields), nested objects, Collections (with their element type), enums (listing the allowed values), the common scalar types, and java.time types (described as ISO-8601 strings). Self-referential types are guarded against infinite recursion.

Used only at extraction time by ExtractionEngine; it never calls a model itself — it is pure reflection over the target class.

See Also:
  • Method Details

    • describe

      public static String describe(Class<?> type)
      Produces the JSON skeleton for the given target type.

      Called once per extraction by ExtractionEngine to build the portion of the prompt that constrains the model's output shape.

      Parameters:
      type - the class the caller wants to extract (record, POJO, etc.)
      Returns:
      a pretty-printed JSON skeleton with field names and type hints