mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
more changes
This commit is contained in:
parent
299f183e66
commit
9db30caff1
6 changed files with 40 additions and 162 deletions
|
|
@ -82,8 +82,20 @@ impl RootContext for FilterContext {
|
|||
self.system_prompt = Rc::new(config.system_prompt);
|
||||
self.prompt_targets = Rc::new(prompt_targets);
|
||||
self.endpoints = Rc::new(config.endpoints);
|
||||
self.agents = Rc::new(config.agents);
|
||||
self.tools = Rc::new(config.tools);
|
||||
//TOOD: check to make sure that agents name is unique
|
||||
let agents_map: HashMap<String, Agent> = config
|
||||
.agents
|
||||
.iter()
|
||||
.map(|agent| (agent.name.clone(), agent.clone()))
|
||||
.collect();
|
||||
self.agents = Rc::new(agents_map);
|
||||
//TODO: check to make sure that tools name is unique
|
||||
let tools_map: HashMap<String, Tool> = config
|
||||
.tools
|
||||
.iter()
|
||||
.map(|tool| (tool.name.clone(), tool.clone()))
|
||||
.collect();
|
||||
self.tools = Rc::new(tools_map);
|
||||
|
||||
if let Some(prompt_guards) = config.prompt_guards {
|
||||
self.prompt_guards = Rc::new(prompt_guards)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ pub struct Configuration {
|
|||
pub ratelimits: Option<Vec<Ratelimit>>,
|
||||
pub tracing: Option<Tracing>,
|
||||
pub mode: Option<GatewayMode>,
|
||||
pub agents: HashMap<String, Agent>,
|
||||
pub tools: HashMap<String, Tool>,
|
||||
pub agents: Vec<Agent>,
|
||||
pub tools: Vec<Tool>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue