mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-05 01:04:35 +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,39 @@
|
||||
using AIStudio.Assistants;
|
||||
using AIStudio.Tools.PluginSystem;
|
||||
|
||||
namespace AIStudio.Settings.DataModel;
|
||||
|
||||
public static class AssistantStartModeExtensions
|
||||
{
|
||||
private static string TB(string fallbackEN) => I18N.I.T(fallbackEN, typeof(AssistantStartModeExtensions).Namespace, nameof(AssistantStartModeExtensions));
|
||||
|
||||
/// <param name="startMode">How the assistant starts.</param>
|
||||
extension(AssistantStartMode startMode)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of the start mode, as the settings show it.
|
||||
/// </summary>
|
||||
public string Name => startMode switch
|
||||
{
|
||||
AssistantStartMode.ASK_EVERY_TIME => TB("Ask every time"),
|
||||
AssistantStartMode.DOCUMENT => TB("Always start with a document"),
|
||||
AssistantStartMode.TEXT => TB("Always start with a text"),
|
||||
AssistantStartMode.LAST_CHOICE => TB("Start with the last choice"),
|
||||
|
||||
_ => TB("Ask every time"),
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets what the assistant works on when it starts; undecided while it still has to ask.
|
||||
/// </summary>
|
||||
/// <param name="lastChoice">What the user last chose in the assistant since AI Studio started; undecided for nothing.</param>
|
||||
public AssistantContentMode InitialContentMode(AssistantContentMode lastChoice) => startMode switch
|
||||
{
|
||||
AssistantStartMode.DOCUMENT => AssistantContentMode.DOCUMENT,
|
||||
AssistantStartMode.TEXT => AssistantContentMode.TEXT,
|
||||
AssistantStartMode.LAST_CHOICE => lastChoice,
|
||||
|
||||
_ => AssistantContentMode.UNDECIDED,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user