mirror of
https://github.com/katanemo/plano.git
synced 2026-05-06 06:12:59 +02:00
feat: add policy provider integration and caching mechanism
This commit is contained in:
parent
6610097659
commit
5aeb69e034
9 changed files with 674 additions and 36 deletions
|
|
@ -9,8 +9,17 @@ use crate::api::open_ai::{
|
|||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Routing {
|
||||
#[serde(alias = "llm_provider")]
|
||||
pub model_provider: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub policy_provider: Option<RoutingPolicyProvider>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct RoutingPolicyProvider {
|
||||
pub url: String,
|
||||
pub headers: Option<HashMap<String, String>>,
|
||||
pub ttl_seconds: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
@ -270,7 +279,7 @@ impl LlmProviderType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct ModelUsagePreference {
|
||||
pub model: String,
|
||||
pub routing_preferences: Vec<RoutingPreference>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue