From 98f50b406e8937abbe317fc1da36211fcc74d068 Mon Sep 17 00:00:00 2001 From: aiueo-1234 <130837816+aiueo-1234@users.noreply.github.com> Date: Mon, 29 Apr 2024 02:21:32 +0900 Subject: [PATCH] =?UTF-8?q?#25=20=E3=82=B9=E3=83=86=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=82=B9=E3=82=92=E5=A4=89=E5=8C=96=E3=81=95=E3=81=9B=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- KoeBook.Core/Services/ClaudeAnalyzerService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/KoeBook.Core/Services/ClaudeAnalyzerService.cs b/KoeBook.Core/Services/ClaudeAnalyzerService.cs index ed3ca12..d005cc9 100644 --- a/KoeBook.Core/Services/ClaudeAnalyzerService.cs +++ b/KoeBook.Core/Services/ClaudeAnalyzerService.cs @@ -1,6 +1,7 @@ using System.Buffers; using System.Text; using KoeBook.Core.Contracts.Services; +using KoeBook.Core.Helpers; using KoeBook.Core.Models; namespace KoeBook.Core.Services; @@ -14,6 +15,7 @@ public partial class ClaudeAnalyzerService(IClaudeService claudeService, IDispla public async ValueTask LlmAnalyzeScriptLinesAsync(BookProperties bookProperties, List scriptLines, CancellationToken cancellationToken) { + var progress = _displayStateChangeService.ResetProgress(bookProperties, GenerationState.Analyzing, 2); var lineNumberingText = LineNumbering(scriptLines); if (_claudeService.Messages is null) { @@ -34,6 +36,7 @@ public async ValueTask LlmAnalyzeScriptLinesAsync(BookProperties bo cancellationToken: cancellationToken ); (var characterList, var characterIdNameDic) = ExtractCharacterList(message1.ToString(), scriptLines); + progress.IncrementProgress(); var message2 = await _claudeService.Messages.CreateAsync(new() { @@ -47,8 +50,8 @@ public async ValueTask LlmAnalyzeScriptLinesAsync(BookProperties bo }, cancellationToken: cancellationToken ); - var characterVoiceMapping = ExtractCharacterVoiceMapping(message2.ToString(), characterIdNameDic); + progress.Finish(); return new(bookProperties, new(characterVoiceMapping)) { ScriptLines = scriptLines }; }