mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-06 04:51:36 +00:00
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:
1 parent
f7666861f1
commit
918572c158
150 files changed
+12850
-302
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace AIStudio.Assistants;
|
||||
|
||||
/// <summary>
|
||||
/// Keeps what the user last chose to work on in each assistant which works on documents as well as on texts.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It keeps the choices only until AI Studio quits, for the start option "Start with the last choice": an assistant
|
||||
/// continues with what the user worked on before and asks again after a restart. A text which another assistant or
|
||||
/// a chat sent to an assistant is no choice of the user.
|
||||
/// </remarks>
|
||||
public sealed class LastContentModeService
|
||||
{
|
||||
private readonly ConcurrentDictionary<Tools.Components, AssistantContentMode> lastModes = new();
|
||||
|
||||
/// <summary>
|
||||
/// Notes what the user chose to work on in an assistant.
|
||||
/// </summary>
|
||||
/// <param name="assistant">The assistant.</param>
|
||||
/// <param name="mode">What the user chose to work on.</param>
|
||||
public void Remember(Tools.Components assistant, AssistantContentMode mode) => this.lastModes[assistant] = mode;
|
||||
|
||||
/// <summary>
|
||||
/// Gets what the user last chose to work on in an assistant; undecided while the user chose nothing there since
|
||||
/// AI Studio started.
|
||||
/// </summary>
|
||||
/// <param name="assistant">The assistant.</param>
|
||||
public AssistantContentMode LastOf(Tools.Components assistant) => this.lastModes.GetValueOrDefault(assistant, AssistantContentMode.UNDECIDED);
|
||||
}
|
||||
Reference in new issue
Block a user