Expand description
This module provides functionality for working with streaming completion models. It provides traits and types for generating streaming completion requests and handling streaming completion responses.
The main traits defined in this module are:
- StreamingPrompt: Defines a high-level streaming LLM one-shot prompt interface
- StreamingChat: Defines a high-level streaming LLM chat interface with history
- StreamingCompletion: Defines a low-level streaming LLM completion interface
Structs§
- Pause
Control - Control for pausing and resuming a streaming response
- RawStreaming
Tool Call - Describes a streaming tool call response (in its entirety)
- Streaming
Completion Response - The response from a streaming completion request;
message and response are populated at the end of the
innerstream.
Enums§
- RawStreaming
Choice - Enum representing a streaming chunk from the model
- Streamed
Assistant Content - Describes responses from a streamed provider response which is either text, a tool call or a final usage response.
- Streamed
User Content - Streamed user content. This content is primarily used to represent tool results from tool calls made during a multi-turn/step agent prompt.
- Tool
Call Delta Content - The content of a tool call delta - either the tool name or argument data
Traits§
- Streaming
Chat - Trait for high-level streaming chat interface
- Streaming
Completion - Trait for low-level streaming completion interface
- Streaming
Prompt - Trait for high-level streaming prompt interface
Functions§
- stream_
to_ stdout - A helper function to stream a completion request to stdout. Tool call deltas are ignored as tool calls are generally much easier to handle when received in their entirety rather than using deltas.
Type Aliases§
- Streaming
Result Not ( wasmand WebAssembly)