dynamo_llm/protocols/common/
postprocessor.rs

1// SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5
6use super::FinishReason;
7use crate::protocols::TokenIdType;
8
9#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
10pub struct PostprocessedResponse {
11    /// Model Deployment Card checksum
12    pub mdcsum: String,
13
14    // if the number of slots for a given request is greater than 1
15    // this indicates the index of the slot for the response
16    pub index: Option<usize>,
17
18    pub finish_reason: Option<FinishReason>,
19
20    // new token_ids
21    pub token_ids: Vec<TokenIdType>,
22
23    // tokens
24    pub tokens: Option<Vec<Option<String>>>,
25
26    // decoded text
27    pub text: Option<String>,
28
29    /// cumulative log probabilities
30    pub cum_log_probs: Option<f64>,
31}