Output format
The response_format stored on a version — null, a JSON object mode, or a named JSON schema — passed through unchanged by compile for you to hand to your provider.
response_format constrains the model's output. A version stores one of three shapes, edited as raw JSON in the dashboard. compile() passes it through unchanged on the response_format field — you hand it to whichever provider supports structured outputs.
The three shapes
Text — no constraint. Stored as null:
nullJSON object — the provider's JSON mode; valid JSON, no fixed shape:
{ "type": "json_object" }JSON schema — output must conform to a named schema:
{
"type": "json_schema",
"json_schema": {
"name": "refund_decision",
"schema": {
"type": "object",
"properties": {
"approved": { "type": "boolean" },
"reason": { "type": "string" }
},
"required": ["approved", "reason"]
},
"strict": true
}
}The strict flag is optional.
Reading it back
const { messages, model, response_format } = prompt.compile({ question: 'refund status?' });
const answer = await openai.chat.completions.create({
model: model.model ?? 'gpt-4o',
messages,
response_format: response_format ?? undefined,
});compiled = prompt.compile(question="refund status?")
answer = openai.chat.completions.create(
model=compiled.model.get("model", "gpt-4o"),
messages=compiled.messages,
response_format=compiled.response_format,
)Like model config and tools, response_format is stored and handed back — never applied by Trodo. Pass it to a provider that supports structured outputs.
MCP servers
Attach a connected MCP server to a prompt by reference — credential_id plus an optional tool_names subset. No secret or schema is stored on the version; tool schemas resolve live at run time.
Caching & availability
The SDK caches prompts and serves a stale copy or your fallback if Trodo is unreachable — so a prompt fetch on your hot path degrades rather than takes your app down.