Add iterative prompt refinement actio

This commit is contained in:
Peer Hogeterp 2026-09-22 16:03:26 +02:00
parent c95cc5bacc
commit 3239c0393c
5 changed files with 32 additions and 0 deletions

View File

@ -2191,6 +2191,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER
-- View -- View
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "View" UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "View"
-- Improve further
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582753277"] = "Improve further"
-- Separate context, task, constraints, and output format with headings or markers. -- Separate context, task, constraints, and output format with headings or markers.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Separate context, task, constraints, and output format with headings or markers." UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Separate context, task, constraints, and output format with headings or markers."

View File

@ -101,6 +101,14 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
protected override IReadOnlyList<IButtonData> FooterButtons => 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 new SendToButton
{ {
Self = Tools.Components.PROMPT_OPTIMIZER_ASSISTANT, Self = Tools.Components.PROMPT_OPTIMIZER_ASSISTANT,
@ -464,6 +472,20 @@ public partial class AssistantPromptOptimizer : AssistantBaseCore<SettingsDialog
this.optimizedPrompt = string.Empty; 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() private void ResetGuidelineSummaryToDefault()
{ {
this.recClarityDirectness = T("Use clear, explicit instructions and directly state quality expectations."); this.recClarityDirectness = T("Use clear, explicit instructions and directly state quality expectations.");

View File

@ -2193,6 +2193,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER
-- View -- View
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "Anzeigen" UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "Anzeigen"
-- Improve further
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582753277"] = "Weiter verbessern"
-- Separate context, task, constraints, and output format with headings or markers. -- Separate context, task, constraints, and output format with headings or markers.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Trennen Sie Kontext, Aufgabe, Einschränkungen und Ausgabeformat mit Überschriften oder Markierungen." UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Trennen Sie Kontext, Aufgabe, Einschränkungen und Ausgabeformat mit Überschriften oder Markierungen."

View File

@ -2193,6 +2193,9 @@ UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER
-- View -- View
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "View" UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582017048"] = "View"
-- Improve further
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1582753277"] = "Improve further"
-- Separate context, task, constraints, and output format with headings or markers. -- Separate context, task, constraints, and output format with headings or markers.
UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Separate context, task, constraints, and output format with headings or markers." UI_TEXT_CONTENT["AISTUDIO::ASSISTANTS::PROMPTOPTIMIZER::ASSISTANTPROMPTOPTIMIZER::T1626024580"] = "Separate context, task, constraints, and output format with headings or markers."

View File

@ -10,6 +10,7 @@
- Added organization-wide management for tools. Among other options, IT departments can switch tools off entirely, disable individual ones, or define the provider trust a tool requires. You do not have to write any of it by hand: set a tool up in the app, then export its configuration as ready-made Lua code for your plugin, with encrypted API keys if you want them. - Added organization-wide management for tools. Among other options, IT departments can switch tools off entirely, disable individual ones, or define the provider trust a tool requires. You do not have to write any of it by hand: set a tool up in the app, then export its configuration as ready-made Lua code for your plugin, with encrypted API keys if you want them.
- Added tool calling to the abilities you can state yourself in the expert provider settings. When you use a model AI Studio does not recognize as tool-capable, you can now declare that it is, the same way you already could for image input or reasoning. It works in the other direction as well: a model AI Studio has never heard of is offered tools, because most models can use them by now. Should one turn out not to be able to, AI Studio says so in plain words and points you to the same setting to switch the ability off again, instead of only passing the provider's error on. - Added tool calling to the abilities you can state yourself in the expert provider settings. When you use a model AI Studio does not recognize as tool-capable, you can now declare that it is, the same way you already could for image input or reasoning. It works in the other direction as well: a model AI Studio has never heard of is offered tools, because most models can use them by now. Should one turn out not to be able to, AI Studio says so in plain words and points you to the same setting to switch the ability off again, instead of only passing the provider's error on.
- Added support for OpenAI's GPT-6 Astra. - Added support for OpenAI's GPT-6 Astra.
- Added a way to refine an optimized prompt again in the Prompt Optimizer. Select "Use as input" to move the latest proposal back into the editable prompt while keeping your recommendations and selections, then make any changes you want before you optimize it again.
- Added the context window to what AI Studio knows about a model, wherever its metadata states one. - Added the context window to what AI Studio knows about a model, wherever its metadata states one.
- Added a live read of that context window at the providers which report it, among them Mistral, Groq, OpenRouter, and self-hosted vLLM servers. You then get the window your own server was started with, not the one the model card advertises. - Added a live read of that context window at the providers which report it, among them Mistral, Groq, OpenRouter, and self-hosted vLLM servers. You then get the window your own server was started with, not the one the model card advertises.
- Added a token count below the message field, so you always see how much of the conversation you have used. It counts everything that travels along: your messages, the files you attached, what your data sources contributed, and the tools you offered the AI. It can be an estimate when a provider does not give AI Studio everything it needs to count exactly. - Added a token count below the message field, so you always see how much of the conversation you have used. It counts everything that travels along: your messages, the files you attached, what your data sources contributed, and the tools you offered the AI. It can be an estimate when a provider does not give AI Studio everything it needs to count exactly.