pub struct AfterResponseContext<'a, T = ()> {
pub operation: &'a str,
pub model: &'a str,
pub request_json: &'a str,
pub response_json: &'a str,
pub duration: Duration,
pub input_tokens: Option<i64>,
pub output_tokens: Option<i64>,
pub state: &'a T,
}Expand description
Context provided after a successful non-streaming response.
This context contains the complete request and response information, allowing interceptors to observe and react to successful API calls.
Fields§
§operation: &'a strThe operation that was performed
model: &'a strThe model that was used
request_json: &'a strThe original request body as JSON
response_json: &'a strThe response body as JSON
duration: DurationTime taken for the request
input_tokens: Option<i64>Number of input tokens used (if available)
output_tokens: Option<i64>Number of output tokens generated (if available)
state: &'a TTyped state from the request context
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for AfterResponseContext<'a, T>
impl<'a, T> RefUnwindSafe for AfterResponseContext<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for AfterResponseContext<'a, T>where
T: Sync,
impl<'a, T> Sync for AfterResponseContext<'a, T>where
T: Sync,
impl<'a, T> Unpin for AfterResponseContext<'a, T>
impl<'a, T> UnwindSafe for AfterResponseContext<'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