pub struct StreamState { /* private fields */ }Expand description
流式响应状态
Implementations§
Source§impl StreamState
impl StreamState
Sourcepub fn ingest_anthropic(
&mut self,
event: AnthropicStreamEvent,
) -> Vec<StreamEvent>
pub fn ingest_anthropic( &mut self, event: AnthropicStreamEvent, ) -> Vec<StreamEvent>
处理 Anthropic 事件
Sourcepub fn ingest_openai(&mut self, chunk: OpenAiStreamChunk) -> Vec<StreamEvent>
pub fn ingest_openai(&mut self, chunk: OpenAiStreamChunk) -> Vec<StreamEvent>
处理 OpenAI 事件
Sourcepub fn ingest_ollama(&mut self, chunk: OllamaStreamChunk) -> Vec<StreamEvent>
pub fn ingest_ollama(&mut self, chunk: OllamaStreamChunk) -> Vec<StreamEvent>
处理 Ollama 流式事件
Sourcepub fn finish(&mut self) -> Vec<StreamEvent>
pub fn finish(&mut self) -> Vec<StreamEvent>
完成流处理
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamState
impl RefUnwindSafe for StreamState
impl Send for StreamState
impl Sync for StreamState
impl Unpin for StreamState
impl UnsafeUnpin for StreamState
impl UnwindSafe for StreamState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more