generateSchema

public final static String generateSchema(SchemaGenerationRequest request)

Generates a JSON Schema for a class of documents using a vision model, with default document settings. The schema is designed for downstream LLM structured-output extraction tasks: it is hard-clamped to the knobs in SchemaGenerationSettings and to the target structured-output dialect selected there, so the same call with the same settings always yields a schema the target accepts.

Return

A JSON envelope object with a schema property (the generated JSON Schema) and a constraints array of cross-field rules in standard JsonLogic. The array is empty unless SchemaGenerationSettings.IncludeConstraints is enabled.

Parameters

request

The schema generation request: the document type the schema must represent (required), an optional natural-language requirement, and up to five example documents used as grounding samples.


public final static String generateSchema(SchemaGenerationRequest request, DocumentSettings settings)

Generates a JSON Schema for a class of documents using a vision model, with explicit document settings. The schema is designed for downstream LLM structured-output extraction tasks: it is hard-clamped to the knobs in SchemaGenerationSettings and to the target structured-output dialect selected there, so the same call with the same settings always yields a schema the target accepts. The vision model connection is resolved from and the matching provider settings class — the same way is configured.

Return

A JSON envelope object with a schema property (the generated JSON Schema) and a constraints array of cross-field rules in standard JsonLogic. The array is empty unless SchemaGenerationSettings.IncludeConstraints is enabled.

Parameters

request

The schema generation request: the document type the schema must represent (required), an optional natural-language requirement, and up to five example documents used as grounding samples.

settings

Document settings carrying SchemaGenerationSettings (schema shape and target dialect) and the vision model connection.