Skip to main content

OutputStream

Type Alias OutputStream 

Source
pub type OutputStream = Receiver<OutputChunk>;
Expand description

A streaming receiver for ACP agent output.

Yields OutputChunks as they arrive from the agent.

§Example

use adk_acp::streaming::stream_prompt;

let mut stream = stream_prompt(&config, "Write a hello world", policy, status).await?;
while let Some(chunk) = stream.recv().await {
    match chunk {
        OutputChunk::Text(t) => print!("{t}"),
        OutputChunk::ToolCall { title } => println!("\n[tool] {title}"),
        OutputChunk::Done => break,
        _ => {}
    }
}

Aliased Type§

pub struct OutputStream { /* private fields */ }