pub struct StreamEndContext<'a, T = ()> {
pub operation: &'a str,
pub model: &'a str,
pub request_json: &'a str,
pub total_chunks: usize,
pub duration: Duration,
pub input_tokens: Option<i64>,
pub output_tokens: Option<i64>,
pub state: &'a T,
}Expand description
Context provided when a streaming response completes.
This context provides summary information about the completed stream, including total chunks and token usage.
Fields§
§operation: &'a strThe operation that was performed
model: &'a strThe model that was used
request_json: &'a strThe original request body as JSON
total_chunks: usizeTotal number of chunks received
duration: DurationTotal time for the streaming response
input_tokens: Option<i64>Total input tokens used (if available)
output_tokens: Option<i64>Total output tokens generated (if available)
state: &'a TTyped state from the request context
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for StreamEndContext<'a, T>
impl<'a, T> RefUnwindSafe for StreamEndContext<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for StreamEndContext<'a, T>where
T: Sync,
impl<'a, T> Sync for StreamEndContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for StreamEndContext<'a, T>
impl<'a, T> UnwindSafe for StreamEndContext<'a, T>where
T: RefUnwindSafe,
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