Whatever message this page gives is out now! Go check it out!
| Guardrail layer | What it controls |
|---|---|
SCHEMA / SCHEMADEFINITION | Shape of the JSON response, field names, data types, required vs. optional |
| System message | Persona, tone, domain restriction, format instruction |
| Input validation | Rejects malformed schemas before any API call is made |
| Response validation | Verifies that the model's response matches expectations |
"thirty" instead of 30. For the full list of supported schema types and provider capabilities, see the schema type reference.// 1. Create a model configuration bound to a specific provider
chatModel = ChatModel({ PROVIDER: "anthropic", APIKEY: "...", MODELNAME: "..." });
// 2. Wrap it in an agent (the object you actually call)
aiService = agent({ CHATMODEL: chatModel });aiService.chat() method accepts the request struct. The SCHEMA key (or SCHEMADEFINITION) is your guardrail declaration.Your CFM / CFC
│
│ SCHEMA = { "name": "String", "age": "Number" }
▼
aiService.chat({ USERMESSAGE: ..., SCHEMA: ... })
│
│ Framework validates schema (throws immediately on bad input)
│ Framework translates schema to provider-specific format
▼
HTTP request → AI Provider API
│
▼
Structured JSON response
│
│ Your code validates / uses response
▼
Application logicaiService.chat() calls in try/catch. Schema errors throw before the API call; network errors throw during it.