diff --git a/src/BE/Controllers/Chats/Chats/ChatController.cs b/src/BE/Controllers/Chats/Chats/ChatController.cs index f9f88a4e..2071667c 100644 --- a/src/BE/Controllers/Chats/Chats/ChatController.cs +++ b/src/BE/Controllers/Chats/Chats/ChatController.cs @@ -174,10 +174,10 @@ ..await GetMessageTree(existingMessages, messageId).ToAsyncEnumerable().SelectAw Response.Headers.CacheControl = "no-cache"; Response.Headers.Connection = "keep-alive"; stopId = stopService.CreateAndCombineCancellationToken(ref cancellationToken); - await YieldResponse(SseResponseLine.CreateStopId(stopId)); + await YieldResponse(SseResponseLine.StopId(stopId)); everYield = true; } - await YieldResponse(SseResponseLine.CreateSegment(seg.TextSegment)); + await YieldResponse(SseResponseLine.Segment(seg.TextSegment)); if (cancellationToken.IsCancellationRequested) { @@ -236,7 +236,7 @@ ..await GetMessageTree(existingMessages, messageId).ToAsyncEnumerable().SelectAw if (errorText != null) { dbAssistantMessage.MessageContents.Add(MessageContent.FromError(errorText)); - await YieldResponse(SseResponseLine.CreateError(errorText)); + await YieldResponse(SseResponseLine.Error(errorText)); } dbAssistantMessage.Usage = icc.ToUserModelUsage(currentUser.Id, await clientInfoManager.GetClientInfo(cancellationToken), isApi: false); db.Messages.Add(dbAssistantMessage); @@ -264,7 +264,7 @@ private async Task YieldTitle(string title) await YieldResponse(SseResponseLine.UpdateTitle("")); foreach (string segment in TestChatService.UnicodeCharacterSplit(title)) { - await YieldResponse(SseResponseLine.CreateSegment(segment)); + await YieldResponse(SseResponseLine.TitleSegment(segment)); } } diff --git a/src/BE/Controllers/Chats/Chats/Dtos/SseResponseLine.cs b/src/BE/Controllers/Chats/Chats/Dtos/SseResponseLine.cs index 24dd425c..58af6533 100644 --- a/src/BE/Controllers/Chats/Chats/Dtos/SseResponseLine.cs +++ b/src/BE/Controllers/Chats/Chats/Dtos/SseResponseLine.cs @@ -18,7 +18,7 @@ public record SseResponseLine public static class SseResponseLine { - public static SseResponseLine CreateSegment(string segment) + public static SseResponseLine Segment(string segment) { return new SseResponseLine { @@ -27,7 +27,7 @@ public static SseResponseLine CreateSegment(string segment) }; } - public static SseResponseLine CreateError(string error) + public static SseResponseLine Error(string error) { return new SseResponseLine { @@ -84,7 +84,7 @@ public static SseResponseLine PostMessage( }; } - public static SseResponseLine CreateStopId(string stopId) + public static SseResponseLine StopId(string stopId) { return new SseResponseLine {