mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 08:37:59 +00:00
Add iterative prompt refinement actio
This commit is contained in:
1 parent
c95cc5bacc
commit
3239c0393c
5 files changed
+32
No files matched your search
@@ -101,6 +101,14 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
|
||||
|
||||
protected override IReadOnlyList<IButtonData> FooterButtons =>
|
||||
[
|
||||
new ButtonData
|
||||
{
|
||||
Text = T("Improve further"),
|
||||
Icon = Icons.Material.Filled.Input,
|
||||
Color = Color.Default,
|
||||
AsyncAction = this.UseOptimizedPromptAsInput,
|
||||
DisabledActionParam = () => string.IsNullOrWhiteSpace(this.optimizedPrompt),
|
||||
},
|
||||
new SendToButton
|
||||
{
|
||||
Self = Tools.Components.PROMPT_OPTIMIZER_ASSISTANT,
|
||||
@@ -464,6 +472,20 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
|
||||
this.optimizedPrompt = string.Empty;
|
||||
}
|
||||
|
||||
private Task UseOptimizedPromptAsInput()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(this.optimizedPrompt))
|
||||
return Task.CompletedTask;
|
||||
|
||||
this.inputPrompt = this.optimizedPrompt;
|
||||
this.ResetOutput();
|
||||
this.ChatThread = null;
|
||||
this.LastUserPrompt = null;
|
||||
this.ResultingContentBlock = null;
|
||||
this.ClearInputIssues();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private void ResetGuidelineSummaryToDefault()
|
||||
{
|
||||
this.recClarityDirectness = T("Use clear, explicit instructions and directly state quality expectations.");
|
||||
|
||||
Reference in new issue
Block a user