Prioritize doctor instructions in AI report prompts
- Extract AI prompt construction into a tested utility for report editor generation. - Make doctor instructions and structured report fields higher priority than old template body and target-region HTML. - Tell the AI not to carry over default gallbladder or liver descriptions when the doctor asks for another procedure or body part. - Limit old full-report context length to reduce anchoring on default template content. - Update README, AGENTS, report editor, design, progress, and testing docs for the AI prompt priority model. - Add unit tests covering AI prompt priority and old-content truncation.
This commit is contained in:
@@ -71,6 +71,16 @@ AI 面板支持两种模式:
|
||||
- 对话模式:根据当前报告内容和图片上下文回答问题。
|
||||
- 修改模式:选中 `.ai-region` 后要求模型返回 JSON,其中包含 `reply` 和 `updatedHtml`。
|
||||
|
||||
AI 提议版本由以下内容生成:
|
||||
|
||||
- 医生在 AI 输入框中的指令。
|
||||
- 当前结构化报告字段,包括手术名称、术前诊断、术中/术后诊断、麻醉方式和报告备注。
|
||||
- 整份报告正文文本,作为低优先级上下文。
|
||||
- 当前选中的 AI 可编辑区域 HTML,作为低优先级格式和旧内容参考。
|
||||
- 用户选择的报告图片或上传给 AI 的图片。
|
||||
|
||||
Prompt 明确规定优先级为:医生指令 > 当前结构化报告字段 > 图片内容 > 旧目标区域/整份报告正文。默认模板中的胆囊、肝脏等旧术式描述不得覆盖医生新指令;如果医生要求生成新的术式或不同部位,AI 应围绕新术式重写目标区域。
|
||||
|
||||
编辑器会监听正文中的 `.ai-region` 变化;用户插入新的 AI 可编辑区域后,AI 撰写面板的目标下拉栏会立即更新,不需要离开页面或刷新。
|
||||
|
||||
模型返回 HTML 后,系统会清理换行和 `<br>`,生成差异预览。用户确认后才写入目标 `.ai-content`。
|
||||
|
||||
Reference in New Issue
Block a user