Schema Guidelines
Pulse API can transform unstructured document content (like Markdown) into structured JSON output by providing a schema definition in your API request. This allows for precise data extraction tailored to your needs.
Schema Parameter (schema
)
The schema
parameter uses a simplified format where you directly specify the expected data types for each key. It supports basic types, arrays, and enums without requiring the full OpenAPI 3.0 specification.
Example 1: Transaction Data
Example 2: Invoice Data
(Note: Types like string
, float
, integer
, date
, boolean
, null
, and simple enum(VALUE1, VALUE2)
definitions are used directly)
Experimental Schema Parameter (experimental-schema
)
The experimental-schema
parameter utilizes a subset of the OpenAPI 3.0 specification for more complex schema definitions.
Supported operations:
type
: (Required) Defines the data type (string
,number
,integer
,boolean
,array
,object
).properties
: (Required forobject
type) Defines key-value pairs within an object, following OpenAPI 3.0 formatting.required
: (Optional forobject
type) An array listing mandatory property keys.items
: (Required forarray
type) Defines the schema for elements within an array, following OpenAPI 3.0 formatting.nullable
: (Optional) Boolean (true
/false
, defaultfalse
). Allows the value to benull
.description
: (Optional) A string providing context or use-case for the value.
Example: Condensed Profile Schema
Schema Prompting
For both schema types, you can enhance extraction accuracy by providing natural language instructions within the schema’s description
fields or as a separate prompt
parameter. These prompts guide the model in mapping document content to your schema, handling logical expressions, complex enum mapping, calculations, and other nuanced extraction requirements.