第 1 周 · D3🔒 锁定约 4 小时
结构化输出:JSON schema、模板与变量、多语言输出
让模型的回答能被程序直接消费:用 schema 约束输出形状、用模板与变量把提示词变成可复用的函数、让同一份提示词稳定输出多种语言。
让模型的回答能被程序直接消费:用 schema 约束输出形状、用模板与变量把提示词变成可复用的函数、让同一份提示词稳定输出多种语言。
面试题库
结构化输出为什么要用 schema 约束,而不是在提示词里写「请输出 JSON」?schema 通过之后还需要校验吗?Why should structured output be enforced with a schema instead of a 'please respond in JSON' instruction, and do you still need validation once the schema passes?
国内高频海外高频基础#structured-output#json-schema🔒 解锁本章后查看答题要点。
提示词模板里哪些内容该做成变量,哪些该写死?变量多了会有什么问题?In a prompt template, what should become a variable and what should stay constant, and what goes wrong when you have too many variables?
国内高频海外高频进阶#prompt-template#structured-output🔒 解锁本章后查看答题要点。
模型返回的 JSON 解析或校验失败时,你会怎么设计兜底?重试几次、怎么重试、失败之后怎么办?When the model's JSON fails to parse or validate, how do you design the fallback — how many retries, how do you retry, and what happens after the last failure?
国内高频海外高频进阶#structured-output#error-handling🔒 解锁本章后查看答题要点。
