Struct HookedModelRequest
pub struct HookedModelRequest<'a> {
pub kind: ModelCallKind,
pub temperature: &'a mut Option<f32>,
pub top_p: &'a mut Option<f32>,
pub headers: &'a mut BTreeMap<String, String>,
pub extra_body: &'a mut Option<Map<String, Value>>,
pub max_output_tokens: &'a mut Option<u32>,
pub metadata: &'a mut BTreeMap<String, String>,
}Expand description
What a model call is, as a model.request hook sees it: the sampling temperature and top-p,
the bound on the answer’s length, the call’s metadata, headers and extra body, and what kind of
call it is. A plugin may read the kind and rewrite the rest in place. The system prompt, the
history, the model, its endpoint and its key are not here.
Fields§
§kind: ModelCallKindA turn’s call, or a compaction’s summary.
temperature: &'a mut Option<f32>The sampling temperature; absent leaves the model’s own.
top_p: &'a mut Option<f32>Nucleus sampling mass; absent leaves the model’s own.
headers: &'a mut BTreeMap<String, String>Headers for this call. A credential-like name fails the call; the key is the deployment’s.
extra_body: &'a mut Option<Map<String, Value>>Members merged over the call’s body. The members the client owns are refused.
max_output_tokens: &'a mut Option<u32>The upper bound on generated tokens; absent leaves the model’s own.
metadata: &'a mut BTreeMap<String, String>What is forwarded as request metadata where the backend supports it.
Auto Trait Implementations§
impl<'a> !UnwindSafe for HookedModelRequest<'a>
impl<'a> Freeze for HookedModelRequest<'a>
impl<'a> RefUnwindSafe for HookedModelRequest<'a>
impl<'a> Send for HookedModelRequest<'a>
impl<'a> Sync for HookedModelRequest<'a>
impl<'a> Unpin for HookedModelRequest<'a>
impl<'a> UnsafeUnpin for HookedModelRequest<'a>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].