Skip to content

Commit

Permalink
#44 LlmStoryGeneratorServiceをStoryCreatorServiceに組み込む
Browse files Browse the repository at this point in the history
  • Loading branch information
aiueo-1234 committed May 1, 2024
1 parent d81701b commit 4cb37ac
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace KoeBook.Core.Contracts.Services;

internal interface ILlmStoryGeneratorService
public interface ILlmStoryGeneratorService
{
ValueTask<string> GenerateStoryAsync(StoryGenre storyGenre, string premise, CancellationToken cancellationToken);
}
1 change: 1 addition & 0 deletions KoeBook/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public App()
services.AddSingleton<IDialogService, DialogService>();
services.AddSingleton<IDisplayStateChangeService, DisplayStateChangeService>();
services.AddSingleton<ICreateCoverFileService, CreateCoverFileService>();
services.AddSingleton<IStoryCreatorService, StoryCreatorService>();
// Views and ViewModels
services.AddTransient<SettingsViewModel>();
Expand Down
13 changes: 13 additions & 0 deletions KoeBook/Services/StoryCreatorService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using KoeBook.Core.Contracts.Services;
using KoeBook.Core.Models;

namespace KoeBook.Services;

public class StoryCreatorService(ILlmStoryGeneratorService llmStoryGeneratorService) : IStoryCreatorService
{
private readonly ILlmStoryGeneratorService _llmStoryGeneratorService = llmStoryGeneratorService;
public async ValueTask<string> CreateStoryAsync(StoryGenre genre, string instruction, CancellationToken cancellationToken)
{
return await _llmStoryGeneratorService.GenerateStoryAsync(genre, instruction, cancellationToken);
}
}
2 changes: 1 addition & 1 deletion KoeBook/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"IEpubGenerateService": false,
"ISoundGenerationSelectorService": false,
"ISoundGenerationService": false,
"IStoryCreaterService": true
"IStoryCreaterService": false
}
}

0 comments on commit 4cb37ac

Please sign in to comment.