Merge branch 'SciSharp:master' into master

This commit is contained in:
Haiping 2025-01-17 18:50:47 -06:00 committed by GitHub
commit fe381066a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 21 additions and 4 deletions

View file

@ -123,6 +123,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.VertexAI",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.Crontab", "src\Infrastructure\BotSharp.Core.Crontab\BotSharp.Core.Crontab.csproj", "{F812BAAE-5A7D-4DF7-8E71-70696B51C61F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.Rules", "src\Infrastructure\BotSharp.Core.Rules\BotSharp.Core.Rules.csproj", "{AFD64412-4D6A-452E-82A2-79E5D8842E29}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -499,6 +501,14 @@ Global
{F812BAAE-5A7D-4DF7-8E71-70696B51C61F}.Release|Any CPU.Build.0 = Release|Any CPU
{F812BAAE-5A7D-4DF7-8E71-70696B51C61F}.Release|x64.ActiveCfg = Release|Any CPU
{F812BAAE-5A7D-4DF7-8E71-70696B51C61F}.Release|x64.Build.0 = Release|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Debug|x64.ActiveCfg = Debug|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Debug|x64.Build.0 = Debug|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|Any CPU.Build.0 = Release|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|x64.ActiveCfg = Release|Any CPU
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -558,6 +568,7 @@ Global
{6D3A54F9-4792-41DB-BE7D-4F7B1D918EAE} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B} = {D5293208-2BEF-42FC-A64C-5954F61720BA}
{F812BAAE-5A7D-4DF7-8E71-70696B51C61F} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
{AFD64412-4D6A-452E-82A2-79E5D8842E29} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19}

View file

@ -19,7 +19,14 @@ public class DistributedLocker : IDistributedLocker
{
var timeout = TimeSpan.FromSeconds(timeoutInSeconds);
var redis = _services.GetRequiredService<IConnectionMultiplexer>();
var redis = _services.GetService<IConnectionMultiplexer>();
if (redis == null)
{
_logger.LogWarning($"The Redis server is experiencing issues and is not functioning as expected.");
await action();
return true;
}
var @lock = new RedisDistributedLock(resource, redis.GetDatabase());
await using (var handle = await @lock.TryAcquireAsync(timeout))
{

View file

@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.0.1-preview.1.24570.5" />
<PackageReference Include="Microsoft.Extensions.AI.Abstractions" Version="9.1.0-preview.1.25064.3" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
</ItemGroup>

View file

@ -66,8 +66,7 @@ public sealed class MicrosoftExtensionsAIChatCompletionProvider : IChatCompletio
if (_services.GetService<IAgentService>() is { } agentService)
{
var functions = agent.Functions.Concat(agent.SecondaryFunctions ?? []);
foreach (var function in functions)
foreach (var function in agent.Functions)
{
if (agentService.RenderFunction(agent, function))
{