pub trait StreamingPrompt<M, R>where
M: CompletionModel + 'static,
<M as CompletionModel>::StreamingResponse: WasmCompatSend,
R: Clone + Unpin + GetTokenUsage,{
// 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§
Sourcefn stream_prompt(
&self,
prompt: impl Into<Message> + WasmCompatSend,
) -> StreamingPromptRequest<M>
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".