pub struct ChatOutcome {
pub finish: Finish,
pub prompt_tokens: u32,
pub completion_tokens: u32,
pub cached_tokens: u32,
}Expand description
What one ChatGenerator::chat call produced: why it ended, plus the real token counts the
handler needs for a truthful usage block (total = prompt + completion). Counts are what the
generator actually tokenized/emitted — never a content.len()/4 estimate.
Fields§
§finish: Finish§prompt_tokens: u32The WHOLE prompt, including any part served from a KV prefix cache — OpenAI’s
usage.prompt_tokens, which clients budget context and cost from.
completion_tokens: u32§cached_tokens: u32How many of prompt_tokens were reused from a KV prefix cache rather than prefilled
(usage.prompt_tokens_details.cached_tokens). 0 for a generator with no prefix cache.
Trait Implementations§
Source§impl Clone for ChatOutcome
impl Clone for ChatOutcome
impl Copy for ChatOutcome
Source§impl Debug for ChatOutcome
impl Debug for ChatOutcome
impl Eq for ChatOutcome
Source§impl PartialEq for ChatOutcome
impl PartialEq for ChatOutcome
impl StructuralPartialEq for ChatOutcome
Auto Trait Implementations§
impl Forget for ChatOutcome
impl Freeze for ChatOutcome
impl Move for ChatOutcome
impl RefUnwindSafe for ChatOutcome
impl Send for ChatOutcome
impl Sync for ChatOutcome
impl Unpin for ChatOutcome
impl UnsafeUnpin for ChatOutcome
impl UnwindSafe for ChatOutcome
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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