pub struct CollectingStreamHandler { /* private fields */ }
Expand description
Default streaming handler that collects chunks
Implementations§
Source§impl CollectingStreamHandler
impl CollectingStreamHandler
Sourcepub fn get_chunks(&self) -> Vec<StreamChunk>
pub fn get_chunks(&self) -> Vec<StreamChunk>
Get collected chunks
Sourcepub fn get_complete_text(&self) -> String
pub fn get_complete_text(&self) -> String
Get complete text
Trait Implementations§
Source§impl Debug for CollectingStreamHandler
impl Debug for CollectingStreamHandler
Source§impl Default for CollectingStreamHandler
impl Default for CollectingStreamHandler
Source§fn default() -> CollectingStreamHandler
fn default() -> CollectingStreamHandler
Returns the “default value” for a type. Read more
Source§impl StreamingHandler for CollectingStreamHandler
impl StreamingHandler for CollectingStreamHandler
Source§fn handle_chunk<'life0, 'async_trait>(
&'life0 self,
chunk: StreamChunk,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_chunk<'life0, 'async_trait>(
&'life0 self,
chunk: StreamChunk,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle a stream chunk
Source§fn handle_completion<'life0, 'async_trait>(
&'life0 self,
_final_message: LLMMessage,
_usage: TokenUsage,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_completion<'life0, 'async_trait>(
&'life0 self,
_final_message: LLMMessage,
_usage: TokenUsage,
) -> Pin<Box<dyn Future<Output = LLMResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle stream completion
Auto Trait Implementations§
impl !Freeze for CollectingStreamHandler
impl RefUnwindSafe for CollectingStreamHandler
impl Send for CollectingStreamHandler
impl Sync for CollectingStreamHandler
impl Unpin for CollectingStreamHandler
impl UnwindSafe for CollectingStreamHandler
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