pub struct GenerateResult {
pub text: String,
pub token_ids: Vec<u32>,
pub prompt_tokens: usize,
pub tokens_generated: usize,
pub finish_reason: String,
pub mtp_drafted: usize,
pub mtp_accepted: usize,
pub token_confidence: Vec<f32>,
pub traces: Vec<TokenTrace>,
}Expand description
Result of a generation call.
Fields§
§text: String§token_ids: Vec<u32>§prompt_tokens: usize§tokens_generated: usize§finish_reason: String§mtp_drafted: usizeSpeculative-decode stats (0/0 when MTP is absent or inactive).
mtp_accepted: usize§token_confidence: Vec<f32>Per-generated-token confidence = softmax probability of the token
that was actually emitted (Born mass on the chosen state). High =
the model was sure; low = it was guessing. Same length as the
generated slice of token_ids.
traces: Vec<TokenTrace>Structured per-token telemetry (B4 channel). Empty unless
set_trace(true); otherwise same length as the generated slice.
Auto Trait Implementations§
impl Freeze for GenerateResult
impl RefUnwindSafe for GenerateResult
impl Send for GenerateResult
impl Sync for GenerateResult
impl Unpin for GenerateResult
impl UnsafeUnpin for GenerateResult
impl UnwindSafe for GenerateResult
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