Skip to main content

Worked examples

Each example stands alone. Save the JSON and Rego files shown on the page, choose Python, TypeScript or cURL, and run the client with your API key. All requests use https://api.blatent.ai.

ExampleWhat it demonstratesExtra context needed
Classify a messageDescriptions, enums and a boolean decisionNone
Extract a bookingText, identifier patterns and date-time formatsNone
Connect output fieldsConditional fields and legal combinationsNone
Apply permissionsSchema conditions plus Rego checks against scopes and stateApplication-supplied permission snapshot
Check totalsExtracted values with exact arithmetic consistencyNone
Extract facts and calculateVariables extracted from prose and checked arithmetic stepsNone
Order datesRelationships between timestamps and an allowed windowWindow supplied as state
Constrain a poemExact text counts and policy repair feedbackNone

Examples distinguish the model's interpretation from what the schema and policy enforce. Outputs marked illustrative explain the response shape. Observed results are identified separately; the poem also demonstrates policy-guided search. See evaluation for testing your own inputs.