This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /api/csharp/requests/schema-generation-request.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. SchemaGenerationRequest

Describes a schema generation request for GenerateSchema. Carries the document type the schema must represent, an optional free-form requirement, and up to five example documents that ground the schema in real layouts.

The example documents are treated as representative samples of future documents the schema has to fit — not as an exhaustive list. The shape of the generated schema (field budget, nesting, target structured-output dialect) is controlled separately via SchemaGenerationSettings.

using Nutrient;

Construction

public SchemaGenerationRequest()

Properties

DocumentType

public string DocumentType { get; set; }

The class of documents the schema must represent (for example, “invoice” or “lab report”). Required; grounds the schema vocabulary.

Type: string

Requirement

public string Requirement { get; set; }

Optional natural-language description of what the schema must capture: fields of interest, granularity, naming preferences, or anything else an extraction engineer would tell a colleague.

Type: string

Methods

AddExampleDocument

public void AddExampleDocument(Document document)

Adds an example document to the request. Up to five example documents can be added; they act as grounding samples of the documents the generated schema has to represent.

Parameters

NameTypeDescription
documentDocumentAn opened document representative of the document type.

Resource management

public void Dispose()

SchemaGenerationRequest implements IDisposable. Call Dispose() or use a C# using declaration to release its native handle right away. If you don’t, the handle is released when the object is garbage collected.