diff --git a/VideoAnalysisCore/AICore/GPT/BserGPT.cs b/VideoAnalysisCore/AICore/GPT/BserGPT.cs index 97957fa..48db489 100644 --- a/VideoAnalysisCore/AICore/GPT/BserGPT.cs +++ b/VideoAnalysisCore/AICore/GPT/BserGPT.cs @@ -10,6 +10,7 @@ using Whisper.net; using Microsoft.Extensions.DependencyInjection; using VideoAnalysisCore.AICore.GPT.ChatGPT; using VideoAnalysisCore.AICore.GPT.DeepSeek; +using System.Text.Json.Serialization; namespace VideoAnalysisCore.AICore.GPT { @@ -51,7 +52,7 @@ namespace VideoAnalysisCore.AICore.GPT /// 此功能处于 Beta 阶段。 如果指定,我们的系统将尽最大努力确定性地采样,这样具有相同 and 参数的重复请求应该返回相同的结果。 无法保证确定性,您应该参考 response 参数来监控后端的变化 /// public int? seed { get; set; } = null; - [json] + [JsonIgnore] public string? title { get; set; } = null; /// /// 推理模型 (deepseek-reasoner) diff --git a/VideoAnalysisCore/AICore/GPT/ChatGPT/ChatGPTClient.cs b/VideoAnalysisCore/AICore/GPT/ChatGPT/ChatGPTClient.cs index 4f82c08..261eacc 100644 --- a/VideoAnalysisCore/AICore/GPT/ChatGPT/ChatGPTClient.cs +++ b/VideoAnalysisCore/AICore/GPT/ChatGPT/ChatGPTClient.cs @@ -46,12 +46,13 @@ namespace VideoAnalysisCore.AICore.GPT.ChatGPT Message[] messageArr = [ new Message(postMessages,"user"), ]; + model = model ?? ChatGPTType.GPT5_mini; messageArr = messageArr.Where(s => s != null).ToArray(); var chatReq = new ChatRequest { taskId = task, model = model, - max_tokens = model == "deepseek-reasoner" ? 16000 : 8000, + max_tokens =8000, stream = true, temperature = 0.2f, messages = messageArr diff --git a/VideoAnalysisCore/AICore/GPT/GPTClient.cs b/VideoAnalysisCore/AICore/GPT/GPTClient.cs index d35326a..36a8da0 100644 --- a/VideoAnalysisCore/AICore/GPT/GPTClient.cs +++ b/VideoAnalysisCore/AICore/GPT/GPTClient.cs @@ -86,14 +86,17 @@ namespace VideoAnalysisCore.AICore.GPT var messageBuilder1 = new StringBuilder(); var lastChat = new ChatResSSE(); var splitCount = "data:".Length; - var maxLoop = 60 * 100000; + var maxLoop = 50 * 200; int threshold = 0; - while (maxLoop > 0) + var startTime= DateTime.Now; + var endTime = startTime.AddHours(1.5); + //最长分析分析时间1.5小时 或者重试读取 1w次 + while (maxLoop > 0 && DateTime.Now < endTime) { line = reader.ReadLine(); if (line is null || string.IsNullOrEmpty(line) || line.StartsWith(": keep-alive")) { - Thread.Sleep(10); + Thread.Sleep(50); maxLoop--; continue; } diff --git a/VideoAnalysisCore/Model/Enum/AttachmentsInfoType.cs b/VideoAnalysisCore/Model/Enum/AttachmentsInfoType.cs index 1893914..939687b 100644 --- a/VideoAnalysisCore/Model/Enum/AttachmentsInfoType.cs +++ b/VideoAnalysisCore/Model/Enum/AttachmentsInfoType.cs @@ -26,7 +26,9 @@ namespace VideoAnalysisCore.Model.Enum [Description("班会")] 班会 = 5, [Description("其他资料")] - 其他资料 = 7 + 其他资料 = 7, + [Description("教研")] + 教研 = 8 } }