Merge branch 'SciSharp:master' into master
This commit is contained in:
commit
bb7c54423e
|
|
@ -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);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
});
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue