Expand description
Keeps a turn that the client abandoned from losing what it had already streamed.
Structs§
- Guarded
Stream 🔒 - Ties a turn’s cancellation guard to its response stream, so cleanup runs when the client drops the stream rather than whenever the turn’s driver function returns.
- Request
Cancelled 🔒Guard
Functions§
- clean_
up_ 🔒abandoned_ turn - Cleans up after a turn the client abandoned mid-stream: answers the tool calls it left without an output, then deletes the response message if it never received any text, or saves the text it did receive as its (incomplete) answer.
- save_
partial_ 🔒answer - Saves
textas the (incomplete) answer of the messagemessage_idalready names, billed forused_tokens.