sensitive words detected (request id: 202605230340172904247103kxTbR6a) at file:/...

2026年05月23日 03:40 15.72 秒 success

错误信息

AI_APICallError: sensitive words detected (request id: 202605230340172904247103kxTbR6a) at file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-CUjkTMRK.js:2082:11 at async postToApi (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-CUjkTMRK.js:1977:24) at async OpenAICompatibleChatLanguageModel.doGenerate (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-BTy3HrgJ.js:375:75) at async wrapStream (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:48708:19) at async wrapStream (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:48614:32) at async fn (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:47480:17) at async file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:43834:19 at async _retryWithExponentialBackoff (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:43997:10) at async streamStep (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:47449:109) at async fn (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-BlW_UB3I.js:47755:5)

AI 解决方案

🔍 错误分析

1. 🌐 错误翻译
原文:AI_APICallError: sensitive words detected
译文:AI API调用错误:检测到敏感词

2. 🎯 原因分析
错误发生在您通过 Cherry Studio 应用程序调用一个兼容 OpenAI 的聊天模型 API 时。API 服务提供商(如 OpenAI 或 DMXAPI)在其安全审核中检测到您请求中的内容包含“敏感词”,因此拒绝了此次 API 调用。这是一个由 API 端触发的内容安全策略错误。

3. 💡 解决方案
这是一个内容审核问题,无法通过修改代码解决。您需要修改发送给 AI 的用户消息。

步骤一:修改提示词
请检查并修改您发送的文本(user 角色消息),移除或替换可能被判定为敏感的词汇、短语或话题。避免涉及暴力、色情、仇恨言论、政治敏感或违反 API 服务条款的内容。
``代码语言
// 错误示例(包含假设的敏感词)
const messages = [
{ role: "user", content: "请为我写一篇关于 [某个敏感话题] 的文章。" }
];

// 正确做法:使用中性、合规的内容
const messages = [
{ role: "user", content: "请为我写一篇关于人工智能发展史的文章。" }
];
`
步骤二:查阅文档
请查阅您所使用的 API 服务(如 DMXAPI 或 OpenAI)的官方使用政策和内容审核指南,以了解其具体的限制范围。

4. 🛡️ 预防措施
内容自审:在发送请求前,对用户输入和系统提示词进行自查,确保符合 API 服务商的规范。
使用预审核工具:在应用层集成本地的内容安全过滤库,对用户输入进行预处理。

  • 合理使用重试:注意错误堆栈中的 _retryWithExponentialBackoff`。对于“敏感词”这类明确的内容错误,盲目重试是无效的,应首先修正请求内容。