pub struct ChatStreamCollector { /* private fields */ }Expand description
Native Chat collector. The SSE decoder must call push_done for [DONE];
EOF after a finish chunk without the framing terminator remains incomplete.
Implementations§
Source§impl ChatStreamCollector
impl ChatStreamCollector
pub fn new(flow: IdentityFlow, target: TargetIdPolicy) -> Self
pub fn with_limits( flow: IdentityFlow, target: TargetIdPolicy, limits: ChatStreamLimits, ) -> Self
pub fn push(&mut self, chunk: ChatCompletionChunk) -> Result<(), TransformError>
pub fn push_done(&mut self) -> Result<(), TransformError>
pub fn finish( self, ) -> Result<Converted<GenerateContentResponseBody>, TransformError>
Auto Trait Implementations§
impl Freeze for ChatStreamCollector
impl RefUnwindSafe for ChatStreamCollector
impl Send for ChatStreamCollector
impl Sync for ChatStreamCollector
impl Unpin for ChatStreamCollector
impl UnsafeUnpin for ChatStreamCollector
impl UnwindSafe for ChatStreamCollector
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