fix missing field
This commit is contained in:
parent
74476030e1
commit
acf1ed9cbc
|
|
@ -2,10 +2,9 @@ namespace BotSharp.Abstraction.Agents.Models;
|
||||||
|
|
||||||
public class MCPTool
|
public class MCPTool
|
||||||
{
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
public string ServerId { get; set; }
|
public string ServerId { get; set; }
|
||||||
|
|
||||||
public bool Disabled { get; set; }
|
public bool Disabled { get; set; }
|
||||||
|
|
||||||
public IEnumerable<MCPFunction> Functions { get; set; } = [];
|
public IEnumerable<MCPFunction> Functions { get; set; } = [];
|
||||||
|
|
||||||
public MCPTool()
|
public MCPTool()
|
||||||
|
|
@ -14,8 +13,14 @@ public class MCPTool
|
||||||
}
|
}
|
||||||
|
|
||||||
public MCPTool(
|
public MCPTool(
|
||||||
|
string name,
|
||||||
|
string serverId,
|
||||||
|
bool disabled = false,
|
||||||
IEnumerable<MCPFunction>? functions = null)
|
IEnumerable<MCPFunction>? functions = null)
|
||||||
{
|
{
|
||||||
|
Name = name;
|
||||||
|
ServerId = serverId;
|
||||||
|
Disabled = disabled;
|
||||||
Functions = functions ?? [];
|
Functions = functions ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -32,6 +37,6 @@ public class MCPFunction
|
||||||
|
|
||||||
public MCPFunction(string name)
|
public MCPFunction(string name)
|
||||||
{
|
{
|
||||||
this.Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,21 +10,25 @@ public class AgentMCPToolMongoElement
|
||||||
public bool Disabled { get; set; }
|
public bool Disabled { get; set; }
|
||||||
public List<McpFunctionMongoElement> Functions { get; set; } = [];
|
public List<McpFunctionMongoElement> Functions { get; set; } = [];
|
||||||
|
|
||||||
public static AgentMCPToolMongoElement ToMongoElement(MCPTool utility)
|
public static AgentMCPToolMongoElement ToMongoElement(MCPTool tool)
|
||||||
{
|
{
|
||||||
return new AgentMCPToolMongoElement
|
return new AgentMCPToolMongoElement
|
||||||
{
|
{
|
||||||
Disabled = utility.Disabled,
|
Name = tool.Name,
|
||||||
Functions = utility.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [],
|
ServerId = tool.ServerId,
|
||||||
|
Disabled = tool.Disabled,
|
||||||
|
Functions = tool.Functions?.Select(x => new McpFunctionMongoElement(x.Name))?.ToList() ?? [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MCPTool ToDomainElement(AgentMCPToolMongoElement utility)
|
public static MCPTool ToDomainElement(AgentMCPToolMongoElement tool)
|
||||||
{
|
{
|
||||||
return new MCPTool
|
return new MCPTool
|
||||||
{
|
{
|
||||||
Disabled = utility.Disabled,
|
Name = tool.Name,
|
||||||
Functions = utility.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [],
|
ServerId = tool.ServerId,
|
||||||
|
Disabled = tool.Disabled,
|
||||||
|
Functions = tool.Functions?.Select(x => new MCPFunction(x.Name))?.ToList() ?? [],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue