Expand description
Miscellaneous helper functions.
Structs§
- Finalized
Tool Call - Finalized tool call with result.
Functions§
- create_
tool_ result_ message - Create a tool result message from a finalized tool call.
- extract_
tool_ calls - Extract tool calls from an assistant message.
- sanitize_
orphaned_ tool_ results - Remove orphaned
ToolResultmessages and orphanedToolCallblocks fromAssistantmessages. - should_
stop_ after_ turn - Check if the loop should stop after a turn due to external cancellation.
- should_
terminate_ batch - Check if a batch of finalized tool calls should terminate the loop.
pi-mono: ALL finalized results must have
terminate === truefor the batch to terminate. This is the unanimous consent pattern.