I'm building a client around streamed OpenAI API responses, and I'm not sure what the safest behavior is if the connection drops partway through. The client may already have received some text or tool-call data when the disconnect happens.
How do you handle streamed response reconnects without accidentally showing duplicated content or running a tool call twice? I'm especially interested in what can and can't be recovered from the events already received.
Can you answer this question?
Write Answer0 Answers