From 3946a3a3a3b28639fbdbf4c4beb836f22326ee0d Mon Sep 17 00:00:00 2001 From: geyun <1556375442@qq.com> Date: Sun, 25 Jan 2026 15:16:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BE=93=E5=87=BA=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server2.js | 73 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/server2.js b/server2.js index 95b3d6d..bdcd11e 100755 --- a/server2.js +++ b/server2.js @@ -1484,18 +1484,39 @@ app.post("/analyze", upload.single("file"), async (req, res) => { const imageAnalysisMessages = [ { role: "system", - content: "你是一名图像分析专家,需要结合历史对话内容分析当前图像。" + content: ` +你是一名图像分析专家。 +你的任务不是描述图像内容,而是: +- 仅提炼【用于后续分析的思考线索】 +- 不出现任何具体物体、文字、数值、位置 +- 不描述画面、不复述图片 +强制规则: +- 不得出现以下词语: + thinking, answer, 思路, 结论, 分析, 推理, 过程 +- 不使用“基于以上”“综合来看”等过渡句 +- 不重复前文 + + +输出要求: +- 仅输出【思路线索】 +- 使用抽象、概括性语言 +- 禁止出现任何图像细节 +` }, ...historyMessages, // 添加历史对话作为上下文 { role: "user", content: [ - { type: "text", text: userPrompt || `请描述图片内容, 请输出【思路概览】,模拟人类分析问题的过程,但不要暴露内部推理细节。 + { type: "text", text: ` +请基于图片,仅输出【思路线索】而不是图片内容。 - 要求: - - 使用项目符号 - - 只输出思路,不给结论 - ` }, +要求: +- 使用项目符号 +- 只描述“分析思路方向” +- 不描述看到什么 +- 不出现“分析过程”“推理”"thinking""answer"等字眼 +- 不下结论 +` }, imageBase64 ? { type: "image_url", @@ -1532,7 +1553,7 @@ app.post("/analyze", upload.single("file"), async (req, res) => { if (delta) { res.write( - `data: ${JSON.stringify({ type: "scene", content: delta })}\n\n` + `data: ${JSON.stringify({ type: "thinking", content: delta })}\n\n` ); } } @@ -1545,13 +1566,21 @@ app.post("/analyze", upload.single("file"), async (req, res) => { { role: "system", content: ` - 你是一名新能源项目AI分析师。 - 请输出【思路概览】,模拟人类分析问题的过程,但不要暴露内部推理细节。 + 你是一名新能源项目AI分析师。 - 要求: - - 使用项目符号 - - 只输出思路,不给结论 - ` + 请基于: + - 历史对话 + - 图片提供的【思路线索】 + + 输出【思路概览】。 + + 要求: + - 模拟人类分析路径 + - 不出现任何图片内容 + - 不给结论 + - 使用项目符号 + - 不出现“分析过程”“推理”"thinking""answer"等字眼 + ` }, ...historyMessages, { @@ -1602,14 +1631,16 @@ app.post("/analyze", upload.single("file"), async (req, res) => { { role: "system", content: ` - 你是一名新能源项目图像分析AI。 - 请基于以下信息,输出【最终结论】: +你是一名新能源项目分析AI。 - 要求: - - 内容完整、专业、可执行 - - 不重复思路概览 - - 可以分段、分点说明 - ` +请基于【思路概览】,输出【最终结论】。 + +要求: +- 专业、完整、可执行 +- 不复述思路 +- 不描述图片 +- 不出现“分析过程”“推理”"thinking""answer"等字眼 +` }, ...historyMessages, { @@ -1618,7 +1649,7 @@ app.post("/analyze", upload.single("file"), async (req, res) => { }, { role: "assistant", - content: sceneText + thinkingText + content: thinkingText } ];