When a message is in violation of Azure OpenAI's content policy, a openai.BadRequestError is triggered, causing the langroid agent to respond with DO-NOT-KNOW.
Original error: 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: https://go.microsoft.com/fwlink/?linkid=2198766", 'type': None, 'param': 'prompt', 'code': 'content_filter', 'status': 400, 'innererror': {'code': 'ResponsibleAIPolicyViolation', 'content_filter_result': {'hate': {'filtered': False, 'severity': 'safe'}, 'self_harm': {'filtered': False, 'severity': 'safe'}, 'sexual': {'filtered': False, 'severity': 'safe'}, 'violence': {'filtered': True, 'severity': 'medium'}}}}}
When a message is in violation of Azure OpenAI's content policy, a
openai.BadRequestError
is triggered, causing thelangroid
agent to respond withDO-NOT-KNOW
.