mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 00:18:00 +00:00
Added retrieval integration, part I (#281)
This commit is contained in:
1 parent
e973b51f75
commit
954cf44939
18 files changed
+477
-31
No files matched your search
@@ -106,17 +106,19 @@ public partial class Writer : MSGComponentBase, IAsyncDisposable
|
||||
};
|
||||
|
||||
var time = DateTimeOffset.Now;
|
||||
var lastUserPrompt = new ContentText
|
||||
{
|
||||
// We use the maximum 160 characters from the end of the text:
|
||||
Text = this.userInput.Length > 160 ? this.userInput[^160..] : this.userInput,
|
||||
};
|
||||
|
||||
this.chatThread.Blocks.Clear();
|
||||
this.chatThread.Blocks.Add(new ContentBlock
|
||||
{
|
||||
Time = time,
|
||||
ContentType = ContentType.TEXT,
|
||||
Role = ChatRole.USER,
|
||||
Content = new ContentText
|
||||
{
|
||||
// We use the maximum 160 characters from the end of the text:
|
||||
Text = this.userInput.Length > 160 ? this.userInput[^160..] : this.userInput,
|
||||
},
|
||||
Content = lastUserPrompt,
|
||||
});
|
||||
|
||||
var aiText = new ContentText
|
||||
@@ -137,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.providerSettings.Model, this.chatThread);
|
||||
await aiText.CreateFromProviderAsync(this.providerSettings.CreateProvider(this.Logger), this.SettingsManager, this.providerSettings.Model, lastUserPrompt, this.chatThread);
|
||||
this.suggestion = aiText.Text;
|
||||
|
||||
this.isStreaming = false;
|
||||
|
||||
Reference in new issue
Block a user