You start streaming the response immediately and kick off your guardrails checks. If the guard rail checks are triggered you cancel the streaming response.
About a year ago I was using an earlier version of Claude to help analyze the transcript from a podcast episode.
I'd fed in a raw transcript and I was asking it to do some basic editing, remove ums and ahs, that kind of thing.
It had streamed about 80% of the episode when it got to a bit where the podcast guest started talking about "bombing a data center"... and right in front of my eyes the entire transcript vanished. Claude effectively retracted the entire thing!
I tried again in a fresh window and hit Ctrl+A plus Ctrl+C while it was running to save as much as I could.
I don't think the latest version of Claude does that any more - if so, I've not seen it.
I'd fed in a raw transcript and I was asking it to do some basic editing, remove ums and ahs, that kind of thing.
It had streamed about 80% of the episode when it got to a bit where the podcast guest started talking about "bombing a data center"... and right in front of my eyes the entire transcript vanished. Claude effectively retracted the entire thing!
I tried again in a fresh window and hit Ctrl+A plus Ctrl+C while it was running to save as much as I could.
I don't think the latest version of Claude does that any more - if so, I've not seen it.