Upgrade LLamaSharp to v0.12

This commit is contained in:
Haiping Chen 2024-05-13 08:57:39 -05:00
parent 53bae70a5a
commit 434b7a68e7
5 changed files with 26 additions and 6 deletions

View file

@ -22,17 +22,19 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.4" />
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="8.0.0" />
<PackageReference Include="AspNet.Security.OAuth.Keycloak" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.2" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.2" />
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.4" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="6.0.27" />
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="6.0.15" />
<PackageReference Include="AspNet.Security.OAuth.Keycloak" Version="6.0.15" />
<PackageReference Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.25" />
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.26" />
</ItemGroup>

View file

@ -126,6 +126,20 @@ public static class BotSharpOpenApiExtensions
});
}
// Wexin OAuth
if (!string.IsNullOrWhiteSpace(config["OAuth:Wexin:ClientId"]) && !string.IsNullOrWhiteSpace(config["OAuth:Wexin:ClientSecret"]))
{
builder = builder.AddWeixin(options =>
{
options.ClientId = config["OAuth:GitHub:ClientId"];
options.ClientSecret = config["OAuth:GitHub:ClientSecret"];
options.Scope.Add("user:email");
options.Backchannel = builder.Services.BuildServiceProvider()
.GetRequiredService<IHttpClientFactory>()
.CreateClient();
});
}
// Add services to the container.
services.AddControllers()
.AddJsonOptions(options =>

View file

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LLamaSharp" Version="0.11.2" />
<PackageReference Include="LLamaSharp" Version="0.12.0" />
</ItemGroup>
<ItemGroup>

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>$(TargetFramework)</TargetFramework>
@ -22,7 +22,7 @@
<ItemGroup>
<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
</ItemGroup>
<ItemGroup>

View file

@ -33,6 +33,10 @@
"ClientId": "",
"ClientSecret": "",
"Version": 22
},
"Weixin": {
"AppId": "",
"AppSecret": ""
}
},