Streaming with input guardrails is throwing 500 sometimes

“POST /api/chat/stream HTTP/1.1” 200 OK
Error getting response: Error code: 500 - {‘error’: {‘message’: ‘An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID req_cb7f62c225f146a9fac15437373fe6ad in your message.’, ‘type’: ‘server_error’, ‘param’: None, ‘code’: ‘server_error’}}. (request_id: req_cb7f62c225f146a9fac15437373fe6ad)
Guardrail execution failed: Error code: 500 - {‘error’: {‘message’: ‘An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID req_cb7f62c225f146a9fac15437373fe6ad in your message.’, ‘type’: ‘server_error’, ‘param’: None, ‘code’: ‘server_error’}}

I am unable to figure out why the api is giving this error. Sometimes, I am getting the response but after the response is executed I am getting this error and sometimes the guardrails intercept the request in the middle of the request and I get a connection aborted error. I am unable to figure out the reason. The only conclusion I came up with was that input guardrails are running in parallel with the request so the parallel execution is sometimes creating a race condition or the process or thread is unable to stop the executions sometimes.

Did you ever manage to solve this please @Yousaf_Khalid?