Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 30 Oct 2026. What's built · Install 0.1.0
jadpo
Reference: AI

AI · rule

semantic.ai_output_type

Type a model is asked to answer as is one no model's answer can be.

Area 21, AI; not declinable; the next step is usually the agent's.

ai.generate's as: names a type a model's answer can be: JSON decoded as json.read decodes it. A reference to a record, a File, Bytes or PresentationText, anywhere in it, is something no model's JSON can be.

example
/// A cake a customer described, as the bakers make it.type CakeDesign = Object {    /// What the bakers call it.    title: Text    /// A picture of it.    preview: Bytes}
example
use bakery/types { CakeBrief, CakeDesign }use bakery/failures { DesignerUnavailable }use bakery/prompts { DesignCake }/// Drafts a cake from a customer's brief.action draft_cake(brief: CakeBrief) fails DesignerUnavailable -> CakeDesign {    return attempt ai.generate(        DesignCake {            brief: brief        },        as: CakeDesign    ) {        refused: DesignerUnavailable        malformed: DesignerUnavailable        timed_out: DesignerUnavailable        over_budget: DesignerUnavailable        too_long: DesignerUnavailable    }}
text
error: A model can't answer as `CakeDesign` --> domains/bakery/actions/draft_cake.jadpo:11:13   |11 |         as: CakeDesign   |             ^^^^^^^^^^ `CakeDesign.preview` is bytes  reason: A model's answer is JSON decoded into `as:`'s type, and `CakeDesign.preview` is bytes, which a model's JSON can't be. A model answers in text.  next: Ask for a type without `CakeDesign.preview` (agent)  rule: semantic.ai_output_type  help: https://jadpo.dev/docs/errors/semantic.ai_output_typecheck failed: 1 error, 7 files

Markdown for agents: /docs/errors/semantic.ai_output_type.md.Built from Jadpo main at a707efb.