Skip to main content

StreamingPrompt

Trait StreamingPrompt 

Source
pub trait StreamingPrompt<M, R>{
    // Required method
    fn stream_prompt(
        &self,
        prompt: impl Into<Message> + WasmCompatSend,
    ) -> StreamingPromptRequest<M>;
}
Expand description

Trait for high-level streaming prompt interface.

This trait provides a simple interface for streaming prompts to a completion model. Implementations can optionally support prompt hooks for observing and controlling the agent’s execution lifecycle.

Required Methods§

Source

fn stream_prompt( &self, prompt: impl Into<Message> + WasmCompatSend, ) -> StreamingPromptRequest<M>

Stream a simple prompt to the model.

Attach hooks to observe or steer the run via StreamingPromptRequest::add_hook.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§