From 6f5429695cb865f7a01b1629cd0fa00d08eb44ff Mon Sep 17 00:00:00 2001 From: zyxucp <286513187@qq.com> Date: Tue, 11 Feb 2025 16:07:41 +0800 Subject: [PATCH] update --- src/AntSK.Domain/Utils/OpenAIHttpClientHandler.cs | 4 ++-- src/AntSK/AntSK.csproj | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AntSK.Domain/Utils/OpenAIHttpClientHandler.cs b/src/AntSK.Domain/Utils/OpenAIHttpClientHandler.cs index 6921508..78a3e3c 100644 --- a/src/AntSK.Domain/Utils/OpenAIHttpClientHandler.cs +++ b/src/AntSK.Domain/Utils/OpenAIHttpClientHandler.cs @@ -23,7 +23,7 @@ namespace AntSK.Domain.Utils var uncaseBody = new StringContent(requestBody, Encoding.UTF8, mediaType); request.Content = uncaseBody; - if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT").ConvertToString() != "Production") + if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT").ConvertToString() == "Development") { //生产环境根据环境变量可去关闭日志 //便于调试查看请求prompt @@ -79,7 +79,7 @@ namespace AntSK.Domain.Utils // 接着,调用基类的 SendAsync 方法将你的修改后的请求发出去 HttpResponseMessage response = await base.SendAsync(request, cancellationToken); - if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT").ConvertToString() != "Production") + if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT").ConvertToString() == "Development") { string responseContent = requestBody.IsStream() ? response.Content.ReadAsStringAsync().Result : response.Content.ReadAsStringAsync().Result.Unescape(); Log.Information("{Message}", $"【模型服务接口返回-{guid},host:{_endPoint}】:{Environment.NewLine}{responseContent}"); diff --git a/src/AntSK/AntSK.csproj b/src/AntSK/AntSK.csproj index ac00d0f..580345e 100644 --- a/src/AntSK/AntSK.csproj +++ b/src/AntSK/AntSK.csproj @@ -7,6 +7,7 @@ AntSK.xml CA1050,CA1707,CA2007,VSTHRD111,CS1591,RCS1110,CA5394,SKEXP0001,SKEXP0002,SKEXP0003,SKEXP0004,SKEXP0010,SKEXP0011,,SKEXP0012,SKEXP0020,SKEXP0021,SKEXP0022,SKEXP0023,SKEXP0024,SKEXP0025,SKEXP0026,SKEXP0027,SKEXP0028,SKEXP0029,SKEXP0030,SKEXP0031,SKEXP0032,SKEXP0040,SKEXP0041,SKEXP0042,SKEXP0050,SKEXP0051,SKEXP0052,SKEXP0053,SKEXP0054,SKEXP0055,SKEXP0060,SKEXP0061,SKEXP0101,SKEXP0102 AntSKlogo.ico + true