aizs 0.1.3

Rust SDK for Chinese LLM APIs including Tongyi, DeepSeek, Wenxin,hunyuan, and Xinghuo
Documentation
/*
 * 作者:天边云
 * 邮箱:zgq3337#qq.com
 */

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone)]
pub enum ModelType {
    Tongyi,
    Wenxin,
    Xinghuo,
    Hunyuan,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
pub struct Message {
    pub role: String,
    pub content: String,
}

impl Message {
    pub fn new(role: impl Into<String>, content: impl Into<String>) -> Self {
        Self {
            role: role.into(),
            content: content.into(),
        }
    }

    pub fn user(content: impl Into<String>) -> Self {
        Self::new("user", content)
    }

    pub fn assistant(content: impl Into<String>) -> Self {
        Self::new("assistant", content)
    }

    pub fn system(content: impl Into<String>) -> Self {
        Self::new("system", content)
    }
}