more updates

This commit is contained in:
Adil Hafeez 2025-05-12 12:55:59 -07:00
parent 1d19f0c2f7
commit f13fc76a4a
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
19 changed files with 431 additions and 454 deletions

View file

@ -6,6 +6,11 @@ use crate::api::open_ai::{
ChatCompletionTool, FunctionDefinition, FunctionParameter, FunctionParameters, ParameterType,
};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Routing {
pub model: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Configuration {
pub version: String,
@ -19,6 +24,7 @@ pub struct Configuration {
pub ratelimits: Option<Vec<Ratelimit>>,
pub tracing: Option<Tracing>,
pub mode: Option<GatewayMode>,
pub routing: Option<Routing>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]

View file

@ -11,3 +11,4 @@ pub mod routing;
pub mod stats;
pub mod tokenizer;
pub mod tracing;
pub mod utils;

View file

@ -0,0 +1,7 @@
pub fn shorten_string(s: &str) -> String {
if s.len() > 80 {
format!("{}...", &s[..80])
} else {
s.to_string()
}
}