Assistant send result (#75)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-08-18 12:32:18 +02:00
1 parent ea0ead58f8
commit 909fbe89bb
36 files changed
+400 -63

No files matched your search

@@ -1,4 +1,4 @@
@page "/assistant/translation"
@attribute [Route(Path.ASSISTANT_TRANSLATION)]
@using AIStudio.Tools
@inherits AssistantBaseCore
@@ -19,6 +19,14 @@ public partial class AssistantTranslation : AssistantBaseCore
language requires, e.g., shorter sentences, you should split the text into shorter sentences.
""";
protected override IReadOnlyList<IButtonData> FooterButtons =>
[
new SendToButton
{
Self = SendToAssistant.TRANSLATION_ASSISTANT,
},
];
private bool liveTranslation;
private bool isAgentRunning;
private string inputText = string.Empty;
@@ -38,6 +46,10 @@ public partial class AssistantTranslation : AssistantBaseCore
this.providerSettings = this.SettingsManager.ConfigurationData.Providers.FirstOrDefault(x => x.Id == this.SettingsManager.ConfigurationData.Translation.PreselectedProvider);
}
var deferredContent = MessageBus.INSTANCE.CheckDeferredMessages<string>(Event.SEND_TO_TRANSLATION_ASSISTANT).FirstOrDefault();
if (deferredContent is not null)
this.inputText = deferredContent;
await base.OnInitializedAsync();
}