mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-06 04:11: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
@@ -211,6 +211,35 @@ public sealed class AssistantSessionDraftTests
|
||||
Assert.That(AssistantLowerBase.IsWorthADraft(state.ToDictionary(), stateWithDefaults.ToDictionary(), holdsSentText: false), Is.False, "Work in progress is not a change the user made.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TheModeOfADocumentAssistantComesBackWithARunOnly()
|
||||
{
|
||||
var state = new AssistantSessionStateWriter();
|
||||
state.Set(DocumentAssistantStateKeys.MODE, AssistantContentMode.DOCUMENT);
|
||||
var fields = state.ToDictionary();
|
||||
|
||||
var modeOfDraft = AssistantContentMode.UNDECIDED;
|
||||
new AssistantSessionStateReader(fields, "Translation", isDraft: true).Restore(DocumentAssistantStateKeys.MODE, value => modeOfDraft = value);
|
||||
|
||||
var modeOfRun = AssistantContentMode.UNDECIDED;
|
||||
new AssistantSessionStateReader(fields, "Translation").Restore(DocumentAssistantStateKeys.MODE, value => modeOfRun = value);
|
||||
|
||||
Assert.That(modeOfDraft, Is.EqualTo(AssistantContentMode.UNDECIDED), "When the user comes back, the assistant starts as its settings say, e.g., asks again what to work on.");
|
||||
Assert.That(modeOfRun, Is.EqualTo(AssistantContentMode.DOCUMENT), "A run brings its mode along, or its progress and its result would stay hidden.");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AChosenModeAloneIsNoChange()
|
||||
{
|
||||
var stateWithDefaults = new AssistantSessionStateWriter();
|
||||
stateWithDefaults.Set(DocumentAssistantStateKeys.MODE, AssistantContentMode.UNDECIDED);
|
||||
|
||||
var state = new AssistantSessionStateWriter();
|
||||
state.Set(DocumentAssistantStateKeys.MODE, AssistantContentMode.TEXT);
|
||||
|
||||
Assert.That(AssistantLowerBase.IsWorthADraft(state.ToDictionary(), stateWithDefaults.ToDictionary(), holdsSentText: false), Is.False, "A draft would not bring the mode back, so choosing it alone is nothing to keep.");
|
||||
}
|
||||
|
||||
[TestCase(typeof(AssistantLowerBase), "INPUT_IS_VALID_STATE_KEY")]
|
||||
[TestCase(typeof(AssistantLowerBase), "INPUT_ISSUES_STATE_KEY")]
|
||||
[TestCase(typeof(AssistantDynamic), "IMAGE_CACHE_STATE_KEY")]
|
||||
|
||||
Reference in new issue
Block a user