pub struct OutputChunk {
pub output_ids: Vec<i32>,
pub finish_reason: Option<String>,
pub prompt_tokens: i64,
pub completion_tokens: i64,
pub cached_tokens: i64,
pub output_token_logprobs: Vec<f64>,
pub finish_details: Option<FinishDetails>,
pub spec_verify_ct: Option<i64>,
pub accept_draft_tokens: Option<f64>,
pub input_token_logprobs: Option<(Vec<Option<f64>>, Vec<i32>)>,
pub input_top_logprobs: Option<PromptTopLogprobs>,
pub output_top_logprobs: Option<TopLogprobs>,
}Expand description
One step of a request’s output.
Fields§
§output_ids: Vec<i32>Token ids generated this step.
finish_reason: Option<String>The finish type ("stop", "length", "abort") on the last chunk.
prompt_tokens: i64Prompt length.
completion_tokens: i64Tokens generated so far.
cached_tokens: i64Prompt tokens served from the prefix cache.
output_token_logprobs: Vec<f64>Logprobs of this step’s tokens; empty when not requested.
finish_details: Option<FinishDetails>The finish reason in full on the last chunk (the matched token, an abort’s message and codes), from an engine that sends it.
spec_verify_ct: Option<i64>Verify rounds so far, with speculative decoding.
accept_draft_tokens: Option<f64>Accepted tokens per verify round once finished, with speculative decoding.
input_token_logprobs: Option<(Vec<Option<f64>>, Vec<i32>)>The prompt logprobs (None for the first position) and their
tokens, in the one chunk that carries them.
input_top_logprobs: Option<PromptTopLogprobs>The prompt positions’ top-k alternatives, beside the prompt logprobs.
output_top_logprobs: Option<TopLogprobs>This step’s tokens’ top-k alternatives, when requested.
Trait Implementations§
Source§impl Clone for OutputChunk
impl Clone for OutputChunk
Source§impl Debug for OutputChunk
impl Debug for OutputChunk
Source§impl From<&RequestOutput<'_>> for OutputChunk
impl From<&RequestOutput<'_>> for OutputChunk
Source§fn from(row: &RequestOutput<'_>) -> Self
fn from(row: &RequestOutput<'_>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OutputChunk
impl PartialEq for OutputChunk
impl StructuralPartialEq for OutputChunk
Auto Trait Implementations§
impl Freeze for OutputChunk
impl RefUnwindSafe for OutputChunk
impl Send for OutputChunk
impl Sync for OutputChunk
impl Unpin for OutputChunk
impl UnsafeUnpin for OutputChunk
impl UnwindSafe for OutputChunk
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