🐛 Fix function call bug, for real this time

This commit is contained in:
2025-11-16 00:52:02 +08:00
parent 310f2c1497
commit 5418489f77
2 changed files with 10 additions and 13 deletions

View File

@@ -73,24 +73,21 @@ public class ThoughtProvider
throw new IndexOutOfRangeException("Unknown thinking provider: " + ModelProviderType);
}
// Add gRPC clients for Thought Plugins
builder.Services.AddServiceDiscoveryCore();
builder.Services.AddServiceDiscovery();
builder.Services.AddAccountService();
builder.Services.AddSphereService();
builder.Plugins.AddFromObject(new SnAccountKernelPlugin(_accountClient));
builder.Plugins.AddFromObject(new SnPostKernelPlugin(_postClient));
return builder.Build();
}
[Experimental("SKEXP0050")]
private void InitializeHelperFunctions()
{
var accountPlugin = new SnAccountKernelPlugin(_accountClient);
var postPlugin = new SnPostKernelPlugin(_postClient);
// Add Solar Network tools plugin
Kernel.ImportPluginFromFunctions("solar_network", [
KernelFunctionFactory.CreateFromMethod(accountPlugin.GetAccount),
KernelFunctionFactory.CreateFromMethod(accountPlugin.GetAccountByName),
KernelFunctionFactory.CreateFromMethod(postPlugin.GetPost),
KernelFunctionFactory.CreateFromMethod(postPlugin.ListPosts),
KernelFunctionFactory.CreateFromMethod(postPlugin.ListPostsWithinTime)
]);
// Add web search plugins if configured
var bingApiKey = _configuration.GetValue<string>("Thinking:BingApiKey");
if (!string.IsNullOrEmpty(bingApiKey))