assistant2: Allow profiles to manage context server tools (#27452)
This PR updates the agent profiles with support for managing context server tools. Release Notes: - N/A
This commit is contained in:
parent
aab02a4166
commit
5953c6167b
3 changed files with 34 additions and 4 deletions
|
@ -9,12 +9,10 @@ pub struct AgentProfile {
|
|||
/// The name of the profile.
|
||||
pub name: SharedString,
|
||||
pub tools: IndexMap<Arc<str>, bool>,
|
||||
#[allow(dead_code)]
|
||||
pub context_servers: IndexMap<Arc<str>, ContextServerPreset>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ContextServerPreset {
|
||||
#[allow(dead_code)]
|
||||
pub tools: IndexMap<Arc<str>, bool>,
|
||||
}
|
||||
|
|
|
@ -412,6 +412,13 @@ impl Default for LanguageModelSelection {
|
|||
pub struct AgentProfileContent {
|
||||
pub name: Arc<str>,
|
||||
pub tools: IndexMap<Arc<str>, bool>,
|
||||
#[serde(default)]
|
||||
pub context_servers: IndexMap<Arc<str>, ContextServerPresetContent>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct ContextServerPresetContent {
|
||||
pub tools: IndexMap<Arc<str>, bool>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, JsonSchema, Debug)]
|
||||
|
@ -522,7 +529,18 @@ impl Settings for AssistantSettings {
|
|||
AgentProfile {
|
||||
name: profile.name.into(),
|
||||
tools: profile.tools,
|
||||
context_servers: IndexMap::default(),
|
||||
context_servers: profile
|
||||
.context_servers
|
||||
.into_iter()
|
||||
.map(|(context_server_id, preset)| {
|
||||
(
|
||||
context_server_id,
|
||||
ContextServerPreset {
|
||||
tools: preset.tools.clone(),
|
||||
},
|
||||
)
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
)
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue