awellis / reflection-mentor

A mentor for reflective writing
MIT License
0 stars 0 forks source link

DO-NOT-KNOW response #12

Open awellis opened 9 months ago

awellis commented 9 months ago

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'}}}}}
awellis commented 9 months ago

the ChatAgent.llm_response(...) returns an empty result, which the Task transforms to DO-NOT-KNOW, so yes that's expected