MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Prompt triggering Azure OpenAI's content management policy

Open jinchihe opened this issue 1 year ago • 2 comments

Bug description

Seems the write_code_review prompt triggerred Azure OpenAI's content management policy, so that some response was filtered.

Bug solved method

Environment information

  • LLM type and model name:
  • System version: macos
  • Python version: 3.11
  • packages version: 0.7.6
  • installation method: pip

Screenshots or logs

2024-03-18 17:34:53.145 | INFO     | metagpt.actions.write_code_review:run:183 - Code review and rewrite board.py: 1/2 | len(iterative_code)=1601, len(self.i_context.code_doc.content)=1601
2024-03-18 17:38:48.672 | WARNING  | metagpt.utils.common:wrapper:572 - There is a exception in role's execution, in order to resume, we delete the newest role communication message in the role's memory.
2024-03-18 17:38:48.681 | ERROR    | metagpt.utils.common:wrapper:554 - Exception occurs, start to serialize the project, exp:
Traceback (most recent call last):
  File "/Users/jason/python/llm/lib/python3.11/site-packages/metagpt/utils/common.py", line 549, in wrapper
    result = await func(self, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jason/python/llm/lib/python3.11/site-packages/metagpt/team.py", line 134, in run
    await self.env.run()
openai.BadRequestError: Error code: 400 - {'error': {'code': 'BadRequest', '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: \r\nhttps://go.microsoft.com/fwlink/?linkid=2198766.", 'param': None, 'type': None}}

jinchihe avatar Mar 18 '24 09:03 jinchihe

This is the bug of Azure OpenAI's content management policy on the LLM side. You can send the board.py source code under the project to Microsoft to report the issue.

iorisa avatar Mar 19 '24 05:03 iorisa

Could you please show me the original prompt word?

geekan avatar Mar 21 '24 03:03 geekan