feat: remove mcptooltemplate

This commit is contained in:
geffzhang 2025-02-26 06:56:46 +08:00
parent 69993bdca8
commit 485757c5f3
3 changed files with 3 additions and 12 deletions

View file

@ -2,8 +2,6 @@ namespace BotSharp.Abstraction.Agents.Models;
public class MCPTool
{
public string Name { get; set; }
public string ServerId { get; set; }
public bool Disabled { get; set; }
@ -16,16 +14,14 @@ public class MCPTool
}
public MCPTool(
string name,
IEnumerable<MCPFunction>? functions = null)
{
Name = name;
Functions = functions ?? [];
}
public override string ToString()
{
return Name;
return ServerId;
}
}
@ -34,8 +30,8 @@ public class MCPFunction
{
public string Name { get; set; }
public MCPFunction()
public MCPFunction(string name)
{
this.Name = name;
}
}

View file

@ -47,7 +47,6 @@ public class McpToolFunction : IFunctionCallback
if (string.IsNullOrEmpty(json))
return [];
// 使用JsonDocument解析JSON字符串
using JsonDocument doc = JsonDocument.Parse(json);
JsonElement root = doc.RootElement;
return JsonElementToDictionary(root);

View file

@ -22,10 +22,8 @@ public class AgentMCPToolMongoElement
{
return new AgentMCPToolMongoElement
{
Name = utility.Name,
Disabled = utility.Disabled,
Functions = utility.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [],
Templates = utility.Templates?.Select(x => new McpTemplateMongoElement(x.Name))?.ToList() ?? []
};
}
@ -33,10 +31,8 @@ public class AgentMCPToolMongoElement
{
return new MCPTool
{
Name = utility.Name,
Disabled = utility.Disabled,
Functions = utility.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [],
Templates = utility.Templates?.Select(x => new ACPTemplate(x.Name))?.ToList() ?? []
};
}
}