mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-05 02:27:21 +00:00
Added an optional notice for AI-generated content (#884)
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
1 parent
f5a257270e
commit
249fc778a2
26 files changed
+406
-46
No files matched your search
@@ -30,6 +30,9 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
||||
[Inject]
|
||||
protected RustService RustService { get; init; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected AIGeneratedContentDisclosureService DisclosureService { get; init; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected ToolRegistry ToolRegistry { get; init; } = null!;
|
||||
|
||||
@@ -108,7 +111,17 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
||||
protected virtual bool ShowSendTo => true;
|
||||
|
||||
protected virtual bool ShowCopyResult => true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Whether "Copy result", and copying or exporting the answers this assistant shows, end them with the
|
||||
/// notice that AI generated them, when that is switched on.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// An assistant whose result is meant for a program or another model rather than for a reader turns
|
||||
/// this off, because one sentence more would change what the result does.
|
||||
/// </remarks>
|
||||
protected virtual bool AddsAIGeneratedContentDisclosure => true;
|
||||
|
||||
protected virtual bool ShowReset => true;
|
||||
|
||||
protected virtual string? SendToChatVisibleUserPromptPrefix => null;
|
||||
@@ -652,7 +665,11 @@ public abstract partial class AssistantBase<TSettings> : AssistantLowerBase wher
|
||||
|
||||
protected async Task CopyToClipboard()
|
||||
{
|
||||
await this.RustService.CopyText2Clipboard(this.Result2Copy());
|
||||
var result = this.Result2Copy();
|
||||
if (this.AddsAIGeneratedContentDisclosure)
|
||||
result = this.DisclosureService.AddDisclosureToMarkdown(result);
|
||||
|
||||
await this.RustService.CopyText2Clipboard(result);
|
||||
}
|
||||
|
||||
private ChatThread CreateSendToChatThread()
|
||||
|
||||
Reference in new issue
Block a user