Module streaming_tool

Module streaming_tool 

Source
Expand description

Streaming tool support for long-running operations

This module provides traits and types for tools that produce streaming output.

§Security Considerations

  • Backpressure: Streams MUST respect consumer pace (DoS prevention)
  • Timeouts: Per-chunk timeouts in addition to total timeout
  • Resource Limits: Maximum chunks per stream to prevent memory exhaustion
  • Cancellation: Streams support graceful cancellation via Drop

§Example

use vex_llm::streaming_tool::{StreamingTool, ToolChunk};

let stream = tool.execute_stream(args);
pin_mut!(stream);
while let Some(chunk) = stream.next().await {
    match chunk {
        ToolChunk::Progress { percent, message } => println!("{}% - {}", percent, message),
        ToolChunk::Complete { result } => println!("Done: {:?}", result.hash),
        _ => {}
    }
}

Structs§

StreamConfig
Configuration for streaming tool execution

Enums§

ToolChunk
A chunk of streaming output from a tool.

Traits§

StreamingTool
Trait for tools that produce streaming output.

Type Aliases§

ToolStream
Type alias for a boxed async stream of tool chunks