in Step 1: Error code: 400 - {'error': {'message': "The response was filtered du...

2026年07月26日 14:07 16.37 秒 success

错误信息

Error in Step 1: Error code: 400 - {'error': {'message': "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: ip:port", 'type': 'upstream_error', 'param': 'prompt', 'code': 'content_filter'}}

AI 解决方案

1. 🌐 错误翻译


原文:The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: ip:port
译文:响应因提示词触发了Azure OpenAI的内容管理策略而被过滤,请修改您的提示词并重试。如需了解更多内容过滤策略,请阅读我们的文档:ip:port

2. 🎯 原因分析


  • 根本原因:提交的提示词内容触发了Azure OpenAI的内容过滤机制,违反了平台的内容管理策略。

  • 上下文:错误发生在调用Azure OpenAI服务时,由于请求中的提示词包含被平台识别为违规的内容,导致服务端主动拦截并返回400状态码,触发内容过滤拦截。
  • 3. 💡 解决方案


  • 核心修复方式:修改触发过滤的提示词内容,规避平台禁止的违规表述,确保符合Azure OpenAI的内容政策。

  • 具体操作:检查原提示词,移除可能存在的敏感词、违规表述或风险内容,替换为合规的表述,以下是合规提示词示例:

  • ``代码语言

    合规提示词示例(替代触发过滤的原提示词)


    prompt = "请帮我生成一段关于自然风光的描述,内容积极健康,突出景色的美好与生机"
    ``

    4. 🛡️ 预防措施


  • 合规性检查前置:发送请求前,先对照Azure OpenAI官方文档的内容过滤策略,逐句检查提示词,剔除敏感、违规内容,确保表述符合平台规范。

  • 违规内容自查工具:可使用Azure OpenAI提供的测试工具(如Azure Portal中的Playground)先模拟发送少量请求,排查触发过滤的具体内容,避免直接批量发送违规请求。