Refactored DI usage for CreateFromProviderAsync (#285)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-02-17 12:41:27 +01:00
1 parent 98810ce884
commit 7c59aa11fe
7 files changed
+9 -15

No files matched your search

+1 -5
View File
@@ -1,7 +1,6 @@
using AIStudio.Chat;
using AIStudio.Components;
using AIStudio.Provider;
using AIStudio.Tools.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
@@ -15,9 +14,6 @@ public partial class Writer : MSGComponentBase, IAsyncDisposable
[Inject]
private ILogger<Chat> Logger { get; init; } = null!;
[Inject]
private DataSourceService DataSourceService { get; init; } = null!;
private static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
private readonly Timer typeTimer = new(TimeSpan.FromMilliseconds(1_500));
@@ -143,7 +139,7 @@ public partial class Writer : MSGComponentBase, IAsyncDisposable
this.isStreaming = true;
this.StateHasChanged();
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(this.Logger), this.SettingsManager, this.DataSourceService, this.providerSettings.Model, lastUserPrompt, this.chatThread);
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(this.Logger), this.providerSettings.Model, lastUserPrompt, this.chatThread);
this.suggestion = aiText.Text;
this.isStreaming = false;