pub async fn stream_to_stdout<R>(
stream: &mut StreamingResult<R>,
) -> Result<PromptResponse, Error>Expand description
Helper function to stream assistant-visible completion output to stdout.
This helper prints streamed assistant text and reasoning. Streaming metadata
events, such as MultiTurnStreamItem::CompletionCall, are not printed;
metadata is returned on the PromptResponse via accessors such as
PromptResponse::completion_calls. A model-turn retry prints a visible
boundary because text already written to stdout cannot be retracted.