Schemas
A schema is a JSON Schema describing the typed output you want from an extraction. lirovo.schemas exposes create, list, and get.
schemas.create(input)#
Registers a new schema and resolves to a Schema. Input is a CreateSchemaInput.
namerequiredstring
Human-readable name for the schema.
descriptionstring | null
Optional free-text description.
jsonSchemarequiredRecord<string, unknown>
The JSON Schema document describing the output shape. Sent on the wire as json_schema.
ts
const schema = await lirovo.schemas.create({
name: "product-mentions",
description: "Products named in the video",
jsonSchema: {
type: "object",
properties: { products: { type: "array", items: { type: "string" } } },
required: ["products"],
},
});
// => Schema { id, name, ... }schemas.list(params?)#
Lists schemas and resolves to a SchemaList. Accepts optional limit and cursor for pagination.
ts
const page = await lirovo.schemas.list({ limit: 20 });
// => SchemaList { data, ... }schemas.get(id)#
Fetches a single schema by id and resolves to a Schema.
ts
const schema = await lirovo.schemas.get("sch_a1b2");