cohere_rust/api/
detokenize.rs

1use serde::{Deserialize, Serialize};
2
3use super::GenerateModel;
4
5#[derive(Serialize, Debug)]
6pub struct DetokenizeRequest<'input> {
7    /// The tokens to be detokenized
8    pub tokens: &'input [u64],
9    /// optional - The model to use for detokenization. Custom models can also be supplied with their full ID.
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub model: Option<GenerateModel>,
12}
13
14#[derive(Deserialize, Debug)]
15pub(crate) struct DetokenizeResponse {
16    /// The text representation of the tokens
17    pub text: String,
18}