docs(skill): param_schema Bricks合规规范——uitype白名单(前端静默丢字段)/媒体专用控件multiple/defaultvalue/枚举code+data/结构常量不进表单/同名去重/存量schema自愈门禁

This commit is contained in:
yumoqing 2026-09-06 13:31:05 +08:00
parent e62fe66af3
commit 24bbd66138

View File

@ -90,6 +90,21 @@ tools: [fetch_model_doc, extract_llm_api_spec, apply_llm_config, apply_model_pri
- 任务查询接口供应商级共用(DashScope 全系生成模型都是 GET /tasks/{task_id}): - 任务查询接口供应商级共用(DashScope 全系生成模型都是 GET /tasks/{task_id}):
查询步骤模板按 `{protocol}-query-{path}` 命名复用,多模型共享一份 查询步骤模板按 `{protocol}-query-{path}` 命名复用,多模型共享一份
**param_schema 必须 Bricks 合规(2026-09-06 用户指正,生成器已硬编码执行)**:
schema 是 Bricks 动态表单的渲染契约,违规字段会被前端**静默丢弃**
(Input.create 遇未注册 uitype 返回 null 只打一行 debug,表单上字段直接消失,无任何报错)。规则:
- uitype 只用 Bricks 已注册控件白名单:text/hidden/code/date/datetime/image/audio/video 等,
**禁 textarea/number 等未注册值**(长文本用 text,数值用 code+data 枚举或 text)
- 媒体字段:专用控件 `image`/`audio`/`video` + `multiple: true`(三数组契约需多选)
- 默认值字段名必须是 `defaultvalue`——`default` 无人消费,等于没有默认值
- 枚举业务参数(文档列了可选值):`uitype: code` + `data: [{value, text}]`,
提取层 field_enums 逐字照抄文档,禁止编造枚举值
- 结构常量(如 media 元素的 type: reference_image)不进表单——用户不该填、填了也没处放
- 同名字段禁止重复出现(旧版曾按示例 3 元素产出 3 个重复 type 字段)
- **自愈门禁**:apply 复用存量模板前跑 `_schema_violations` 体检,hard 违规
(未注册 uitype/default/重复/结构常量)一律弃用重建,soft(如缺 multiple)仅提示——
存量数据跟着代码自动痊愈,不需要人工去页面改
**助手注意事项**: **助手注意事项**:
- extract 时确保 `request_example`/`response_example`/`request_headers` 逐字提取—— - extract 时确保 `request_example`/`response_example`/`request_headers` 逐字提取——
它们是模板生成的唯一事实来源,漏提会降级为 request_fields 兜底(无默认值,notes 会警告) 它们是模板生成的唯一事实来源,漏提会降级为 request_fields 兜底(无默认值,notes 会警告)