pub struct CompletedRequest {
pub id: RequestId,
pub prompt_tokens: Vec<u32>,
pub generated_tokens: Vec<u32>,
pub state: RequestState,
pub processing_time_ms: u64,
pub waiting_time_ms: u64,
pub prefill_time_ms: u64,
pub decode_time_ms: u64,
pub decode_steps: usize,
pub tokens_per_second: f64,
pub error: Option<String>,
pub finish_reason: FinishReason,
}Expand description
Result of a completed request
Fields§
§id: RequestIdRequest ID
prompt_tokens: Vec<u32>Original prompt tokens
generated_tokens: Vec<u32>Generated tokens
state: RequestStateFinal state
processing_time_ms: u64Total processing time
waiting_time_ms: u64Time spent waiting
prefill_time_ms: u64Prefill time
decode_time_ms: u64Decode time
decode_steps: usizeNumber of decode steps
tokens_per_second: f64Tokens per second during decode
error: Option<String>Error message if failed
finish_reason: FinishReasonFinish reason
Implementations§
Source§impl CompletedRequest
impl CompletedRequest
Sourcepub fn success(running: &RunningRequest, prefill_time_ms: u64) -> Self
pub fn success(running: &RunningRequest, prefill_time_ms: u64) -> Self
Create a successful completion
Sourcepub fn failure(running: &RunningRequest, error: impl Into<String>) -> Self
pub fn failure(running: &RunningRequest, error: impl Into<String>) -> Self
Create a failed completion
Sourcepub fn cancelled(running: &RunningRequest) -> Self
pub fn cancelled(running: &RunningRequest) -> Self
Create a cancelled completion
Sourcepub fn total_tokens(&self) -> usize
pub fn total_tokens(&self) -> usize
Get total token count
Trait Implementations§
Source§impl Clone for CompletedRequest
impl Clone for CompletedRequest
Source§fn clone(&self) -> CompletedRequest
fn clone(&self) -> CompletedRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompletedRequest
impl Debug for CompletedRequest
Source§impl From<CompletedRequest> for GenerationResult
impl From<CompletedRequest> for GenerationResult
Source§fn from(completed: CompletedRequest) -> Self
fn from(completed: CompletedRequest) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CompletedRequest
impl RefUnwindSafe for CompletedRequest
impl Send for CompletedRequest
impl Sync for CompletedRequest
impl Unpin for CompletedRequest
impl UnwindSafe for CompletedRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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