mirror of
https://github.com/katanemo/plano.git
synced 2026-04-29 19:06:34 +02:00
orchestration integration (#623)
* orchestration integration * Convert compact json to spaced json
This commit is contained in:
parent
d5a273f740
commit
cb82a83c7b
6 changed files with 1164 additions and 1 deletions
|
|
@ -267,6 +267,39 @@ pub struct RoutingPreference {
|
|||
pub description: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct AgentUsagePreference {
|
||||
pub model: String,
|
||||
pub orchestration_preferences: Vec<OrchestrationPreference>,
|
||||
}
|
||||
|
||||
/// OrchestrationPreference with custom serialization to always include default parameters.
|
||||
/// The parameters field is always serialized as:
|
||||
/// {"type": "object", "properties": {}, "required": []}
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct OrchestrationPreference {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
impl serde::Serialize for OrchestrationPreference {
|
||||
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
|
||||
where
|
||||
S: serde::Serializer,
|
||||
{
|
||||
use serde::ser::SerializeStruct;
|
||||
let mut state = serializer.serialize_struct("OrchestrationPreference", 3)?;
|
||||
state.serialize_field("name", &self.name)?;
|
||||
state.serialize_field("description", &self.description)?;
|
||||
state.serialize_field("parameters", &serde_json::json!({
|
||||
"type": "object",
|
||||
"properties": {},
|
||||
"required": []
|
||||
}))?;
|
||||
state.end()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
//TODO: use enum for model, but if there is a new model, we need to update the code
|
||||
pub struct LlmProvider {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue