Merge branch 'SciSharp:master' into master

This commit is contained in:
evan-cao-wb 2025-03-28 10:42:43 -05:00 committed by GitHub
commit bb7c54423e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View file

@ -55,13 +55,13 @@ public class MCPToolAgentHook : AgentHookBase
var mcpClient = await mcpClientManager.GetMcpClientAsync(item.ServerId);
if (mcpClient != null)
{
var tools = await mcpClient.ListToolsAsync().ToListAsync();
/*var tools = await mcpClient.ListToolsAsync().ToListAsync();
var toolnames = item.Functions.Select(x => x.Name).ToList();
foreach (var tool in tools.Where(x => toolnames.Contains(x.Name, StringComparer.OrdinalIgnoreCase)))
{
var funDef = AIFunctionUtilities.MapToFunctionDef(tool);
functionDefs.Add(funDef);
}
}*/
}
}

View file

@ -45,7 +45,7 @@ public class McpPlugin : IBotSharpPlugin
private async Task RegisterFunctionCall(IServiceCollection services, McpServerConfig server)
{
var client = await clientManager.GetMcpClientAsync(server.Id);
var tools = await client.ListToolsAsync().ToListAsync();
/*var tools = await client.ListToolsAsync().ToListAsync();
foreach (var tool in tools)
{
@ -56,6 +56,6 @@ public class McpPlugin : IBotSharpPlugin
var funcTool = new McpToolAdapter(provider, tool, clientManager);
return funcTool;
});
}
}*/
}
}

View file

@ -178,10 +178,11 @@ public class AgentController : ControllerBase
public async Task<IEnumerable<Tool>> GetMCPTools(string serverId)
{
var client = await _clientManager.GetMcpClientAsync(serverId);
var tools = await client.ListToolsAsync().ToListAsync();
throw new NotImplementedException();
/*var tools = await client.ListToolsAsync().ToListAsync();
return tools.Where(x => !string.IsNullOrWhiteSpace(x.Name))
.OrderBy(x => x.Name).ToList();
.OrderBy(x => x.Name).ToList();*/
}
[HttpGet("/agent/labels")]