Provider scenario tests (#3688)
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
@@ -63,7 +63,7 @@ const DEFAULT_MAX_TURNS: u32 = 1000;
|
||||
/// The main goose Agent
|
||||
pub struct Agent {
|
||||
pub(super) provider: Mutex<Option<Arc<dyn Provider>>>,
|
||||
pub(super) extension_manager: Arc<RwLock<ExtensionManager>>,
|
||||
pub extension_manager: Arc<RwLock<ExtensionManager>>,
|
||||
pub(super) sub_recipe_manager: Mutex<SubRecipeManager>,
|
||||
pub(super) tasks_manager: TasksManager,
|
||||
pub(super) final_output_tool: Arc<Mutex<Option<FinalOutputTool>>>,
|
||||
|
||||
@@ -338,12 +338,16 @@ impl ExtensionManager {
|
||||
.insert(sanitized_name.clone());
|
||||
}
|
||||
|
||||
self.clients
|
||||
.insert(sanitized_name.clone(), Arc::new(Mutex::new(client)));
|
||||
|
||||
self.add_client(sanitized_name, client);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn add_client(&mut self, client_name: String, client: Box<dyn McpClientTrait>) {
|
||||
let sanitized_name = normalize(client_name);
|
||||
self.clients
|
||||
.insert(sanitized_name, Arc::new(Mutex::new(client)));
|
||||
}
|
||||
|
||||
/// Get extensions info
|
||||
pub async fn get_extensions_info(&self) -> Vec<ExtensionInfo> {
|
||||
self.clients
|
||||
|
||||
@@ -34,9 +34,7 @@ async fn toolshim_postprocess(
|
||||
|
||||
impl Agent {
|
||||
/// Prepares tools and system prompt for a provider request
|
||||
pub(crate) async fn prepare_tools_and_prompt(
|
||||
&self,
|
||||
) -> anyhow::Result<(Vec<Tool>, Vec<Tool>, String)> {
|
||||
pub async fn prepare_tools_and_prompt(&self) -> anyhow::Result<(Vec<Tool>, Vec<Tool>, String)> {
|
||||
// Get tool selection strategy from config
|
||||
let config = Config::global();
|
||||
let router_tool_selection_strategy = config
|
||||
|
||||
Reference in New Issue
Block a user