pub struct RequestHooks {
pub payload: Option<Hook<Value, Value>>,
pub headers: Option<Hook<RequestHeaders, RequestHeaders>>,
pub response: Option<Hook<ProviderResponse, ()>>,
pub stream_event: Option<Hook<Value, ()>>,
}Expand description
What a session observes of its requests: pi-ai’s onPayload,
onResponse and onProviderStreamEvent options, and pi’s
transformHeaders.
Fields§
§payload: Option<Hook<Value, Value>>Sees each request body, as the wire API would send it, and returns the body to send.
headers: Option<Hook<RequestHeaders, RequestHeaders>>Sees the headers of each request, credentials’ included, and returns
the headers to send. None removes one.
response: Option<Hook<ProviderResponse, ()>>Sees each successful response.
stream_event: Option<Hook<Value, ()>>Sees each streamed event, as parsed, before it is normalized.
Implementations§
Source§impl RequestHooks
impl RequestHooks
Trait Implementations§
Source§impl Clone for RequestHooks
impl Clone for RequestHooks
Source§impl Debug for RequestHooks
impl Debug for RequestHooks
Auto Trait Implementations§
impl !RefUnwindSafe for RequestHooks
impl !UnwindSafe for RequestHooks
impl Forget for RequestHooks
impl Freeze for RequestHooks
impl Send for RequestHooks
impl Sync for RequestHooks
impl Unpin for RequestHooks
impl UnsafeUnpin for RequestHooks
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