We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c8eb7aa + 57e40f0 commit b23cd20Copy full SHA for b23cd20
src/Infrastructure/BotSharp.Abstraction/Agents/AgentHookBase.cs
@@ -71,7 +71,14 @@ public virtual void OnAgentUtilityLoaded(Agent agent)
71
72
var (functions, templates) = GetUtilityContent(agent);
73
74
- agent.Functions.AddRange(functions);
+ foreach (var fn in functions)
75
+ {
76
+ if (!agent.Functions.Any(x => x.Name.Equals(fn.Name, StringComparison.OrdinalIgnoreCase)))
77
78
+ agent.Functions.Add(fn);
79
+ }
80
81
+
82
foreach (var prompt in templates)
83
{
84
agent.Instruction += $"\r\n\r\n{prompt}\r\n\r\n";
0 commit comments