Generate Schema
AI-generatedSummary
Generate a JSON schema describing the structure of data inferred from a document or image by Upstage's Information Extraction model.
Inputs
- Input Type (required) — Select whether to provide the document/image as binary data from a previous node or via an image URL.
- Binary Property — If using binary input, specify the name of the binary property containing the file (default: 'document').
- Image URL — If using URL input, specify the publicly accessible HTTPS URL of the image.
- Model (required) — Choose the Upstage information extraction model to use (currently only 'information-extract').
- Guidance (optional) — Optional text instruction to influence the schema generation (e.g., to tailor the schema for specific document types).
- Return (required) — Choose what to return: only the extracted JSON schema, the schema JSON, or the full API response.
Output shape
a single JSON object representing the generated JSON schema or full response, paired with the input item and optionally including the input binary data
The operation returns the generated schema JSON in the chosen format; if JSON parsing of the API response fails, raw text is returned under a '_raw' property. The operation requires an Upstage API credential. Binary input must specify a valid binary property containing the file data. When using URL input, the URL must be provided.
Examples
Example 1: Generate a schema from a scanned invoice image passed as binary data with a guidance prompt.
Set Input Type to 'binary', Binary Property to the binary key containing the invoice PDF or image, provide guidance prompt such as 'Generate a schema suitable for invoices', and select the desired Return mode.