model-gateway-rs 0.2.0

A Rust library for model gateway services, providing traits and SDKs for various AI models.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TextPrompt {
    pub prompt: String,
    pub system_prompt: Option<String>,
    pub temperature: Option<f32>,
    pub top_p: Option<f32>,
    // 可扩展:stop, max_tokens 等
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TextResponse {
    pub content: String,
    pub raw: Option<serde_json::Value>,
}