We need to have a way to catch these exceptions so...
# marvin-ai
d
We need to have a way to catch these exceptions somewhere deep inside ControlFlow and then do a retry:
Copy code
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid parameter: messages with role 'tool' must be a response to a preceeding message with 'tool_calls'.", 'type': 'invalid_request_error', 'param': 'messages.[1].role', 'code': None}}