pub trait ChatRequestModel: ModelName + ChatRequestModel {
const MAX_TOKENS: u32;
}Expand description
Frozen request constraints shared by every chat model schema.
The associated constants let validation enforce family-specific limits without exposing a catch-all request body that accepts invalid fields. The trait is sealed; downstream model identifiers cannot opt into frozen Chat operations by implementing capability markers themselves.
ⓘ
use zai_rs::model::traits::{ChatRequestModel, ModelName};
#[derive(serde::Serialize)]
struct UnofficialChat;
impl From<UnofficialChat> for String {
fn from(_: UnofficialChat) -> Self {
"unofficial-chat".to_owned()
}
}
impl ModelName for UnofficialChat {
const NAME: &'static str = "unofficial-chat";
}
impl ChatRequestModel for UnofficialChat {
const MAX_TOKENS: u32 = 1_024;
}Required Associated Constants§
Sourceconst MAX_TOKENS: u32
const MAX_TOKENS: u32
Largest max_tokens value accepted by this model’s request schema.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".