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.
/// 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}
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 }}
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, andCakeDesign.previewis 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_ type
Markdown for agents: /docs/errors/semantic.ai_output_type.md.Built from Jadpo main at aee2e8f.