Added whole documents to the Translation, Grammar & Spelling, and Rewrite & Improve assistants (#1179)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Sabrina-devopsandThorsten Sommer authored and GitHub committed 2026-11-28 20:27:23 +01:00
1 parent f7666861f1
commit 918572c158
150 files changed
+12850 -302

No files matched your search

@@ -108,7 +108,16 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
protected abstract Func<Task> SubmitAction { get; }
protected virtual bool SubmitDisabled => false;
/// <summary>
/// Whether the assistant shows its submit button at all.
/// </summary>
/// <remarks>
/// An assistant which first asks what to work on, e.g., a document or a text, hides the button
/// until the user chose, since there is nothing to submit before.
/// </remarks>
protected virtual bool ShowSubmit => true;
private protected virtual RenderFragment? Body => null;
private protected virtual RenderFragment? AfterSubmitContent => null;
@@ -504,8 +513,22 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
sessionCancellationTokenSource?.Dispose();
await this.RefreshAssistantUIAsync();
}
// Once the run is over, so that what the assistant does next, e.g., asking where to save, is not part of it:
if (!this.isDisposed)
await this.OnRunFinishedAsync(sessionStatus);
}
/// <summary>
/// Called after a run of this assistant ended, while the user still looks at the assistant.
/// </summary>
/// <remarks>
/// An assistant whose result is a file offers to save it here. Nothing calls this when the user left the
/// assistant during the run: a dialog would open over whatever they look at now.
/// </remarks>
/// <param name="status">How the run ended.</param>
protected virtual Task OnRunFinishedAsync(AssistantSessionStatus status) => Task.CompletedTask;
/// <summary>
/// Tells the user that the assistant cannot start with the selected provider, together with whatever else is missing.
/// </summary>