Add a grammar and spell checker assistant (#72)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-08-13 08:57:58 +02:00
1 parent 77e7e044e3
commit 05a7e44de4
14 files changed
+212 -5

No files matched your search

@@ -0,0 +1,3 @@
namespace AIStudio.Tools;
public readonly record struct ButtonData(string Text, string Icon, Color Color, string Tooltip, Func<Task> AsyncAction);
@@ -42,4 +42,12 @@ public static class CommonLanguageExtensions
return language.Name();
}
public static string NameSelectingOptional(this CommonLanguages language)
{
if(language is CommonLanguages.AS_IS)
return "Do not specify the language";
return language.Name();
}
}
@@ -0,0 +1,11 @@
using AIStudio.Components;
namespace AIStudio.Tools;
public static class JsRuntimeExtensions
{
public static async Task GenerateAndShowDiff(this IJSRuntime jsRuntime, string text1, string text2)
{
await jsRuntime.InvokeVoidAsync("generateDiff", text1, text2, AssistantBase.ASSISTANT_RESULT_DIV_ID, AssistantBase.AFTER_RESULT_DIV_ID);
}
}