In this section, we will see how to use the methods of the schemas client.

The Schema Object

Schema Object
object

A Schema object represents a JSON schema for structured data extraction.

Load Schema from JSON Schema

Load Schema from Pydantic BaseModel

Generate Schema (Coming Soon)

The Generate Schema endpoint allows you to automatically generate a JSON Schema from a set of example documents. This is particularly useful when you want to create a schema that captures all the important fields and patterns present in your documents.

You can provide multiple documents to ensure the generated schema covers all possible variations in your data structure. The AI will analyze the documents and create a comprehensive schema with appropriate field descriptions and validation rules.

Promptify Schema (Coming Soon)

The Promptify Schema endpoint allows you to enhance an existing JSON Schema with AI-generated prompts and descriptions. By analyzing example documents, it can add helpful X-Directives (X-SystemPrompt, X-FieldPrompt and X-ReasoningPrompt) that will guide the AI in extracting the right information.

This is particularly useful when you already have a schema structure but want to improve the quality of AI extractions by adding more context and guidance through prompts.