输出格式(formats)
formats 决定响应 data 中会出现哪些字段。默认值是 ["markdown"]。
字符串格式(最常用)
Section titled “字符串格式(最常用)”| format | data 对应字段 | 说明 |
|---|---|---|
markdown | data.markdown | 清洗后的 Markdown |
html | data.html | 清洗后的 HTML |
rawHtml | data.rawHtml | 原始 HTML |
links | data.links | 链接列表 |
images | data.images | 图片列表 |
summary | data.summary | LLM 生成摘要 |
branding | data.branding | 站点设计系统/品牌画像 |
audio | data.audio | 音频资源(例如 YouTube 转 MP3) |
对象格式(带选项)
Section titled “对象格式(带选项)”JSON 抽取
Section titled “JSON 抽取”formats: [ { type: 'json', prompt: 'Extract the key fields', schema: { type: 'object', properties: { title: { type: 'string' } } }, },]| 字段 | 类型 | 说明 |
|---|---|---|
type | "json" | 固定值 |
schema | object | JSON Schema |
prompt | string | 可选提示词 |
响应字段:data.json
Screenshot 截图
Section titled “Screenshot 截图”formats: [{ type: 'screenshot', fullPage: true, quality: 80 }]| 字段 | 类型 | 说明 |
|---|---|---|
type | "screenshot" | 固定值 |
fullPage | boolean | 是否整页 |
quality | number | 质量参数(实现相关) |
viewport | object | { width, height } |
响应字段:data.screenshot
Change Tracking 变更追踪
Section titled “Change Tracking 变更追踪”formats: [{ type: 'changeTracking', modes: ['json', 'git-diff'] }]| 字段 | 类型 | 说明 |
|---|---|---|
type | "changeTracking" | 固定值 |
modes | string[] | 变更输出模式,例如 json / git-diff |
tag | string | 可选 tag |
schema | object | 可选 schema |
prompt | string | 可选 prompt |
响应字段:data.changeTracking
注意:changeTracking 需要 formats 同时包含 markdown。
attributes 属性抽取
Section titled “attributes 属性抽取”formats: [{ type: 'attributes', selectors: [{ selector: 'a', attribute: 'href' }] }]| 字段 | 类型 | 说明 |
|---|---|---|
type | "attributes" | 固定值 |
selectors | array | [{ selector, attribute }] |
响应字段:实现相关(取决于后端版本与输出约定)。