pub struct ChatOptions {
pub on_upstream_activity: Option<UpstreamActivityCallback>,
pub on_gateway_request_id: Option<GatewayRequestIDCallback>,
}Expand description
Optional observers for model requests. Existing methods use empty options.
Activity runs once per decoded SSE line, before filtering/conversion, including
comments and empty lines. The ID callback runs before reading the final
response body (including HTTP errors), after the one allowed 401 refresh.
Callbacks must be short, synchronous and nonblocking. Unwinding panics are
caught and that callback is disabled for the operation; the process panic
hook still runs. panic=abort cannot be caught. Returned streams retain their
normal cancellation and backpressure behavior.
Fields§
§on_upstream_activity: Option<UpstreamActivityCallback>§on_gateway_request_id: Option<GatewayRequestIDCallback>Trait Implementations§
Source§impl Clone for ChatOptions
impl Clone for ChatOptions
Auto Trait Implementations§
impl !RefUnwindSafe for ChatOptions
impl !UnwindSafe for ChatOptions
impl Freeze for ChatOptions
impl Send for ChatOptions
impl Sync for ChatOptions
impl Unpin for ChatOptions
impl UnsafeUnpin for ChatOptions
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