Skip to main content

ChatRequestModel

Trait ChatRequestModel 

Source
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§

Source

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".

Implementors§

Source§

impl ChatRequestModel for GLM5

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_6

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_7

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_1v_thinking_flash

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_1v_thinking_flashx

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_5_air

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_5_airx

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_5_flash

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_6v

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_6v_flash

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_6v_flashx

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_7_flash

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_7_flashx

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_flash_250414

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_flashx_250414

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM4_voice

Source§

const MAX_TOKENS: u32 = 4_096

Source§

impl ChatRequestModel for GLM4v_flash

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM5V_turbo

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM5_1

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM5_2

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for GLM5_turbo

Source§

const MAX_TOKENS: u32 = 131072

Source§

impl ChatRequestModel for autoglm_phone

Source§

const MAX_TOKENS: u32 = 131072