mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-14 01:47:22 +00:00
Added the choice between formal and informal address to the whole app (#1200)
This commit is contained in:
1 parent
382db4b8d0
commit
c9a376f742
342 files changed
+14378
-1893
No files matched your search
@@ -5,13 +5,13 @@
|
||||
@if (this.provideHistory)
|
||||
{
|
||||
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
|
||||
<MudTextField T="string" @bind-Text="@this.inputHistory" Validation="@this.ValidateHistory" Label="@T("Previous conversation")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Provide the previous conversation, e.g., the last e-mail, the last chat, etc.")" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.INPUT_TEXT"/>
|
||||
<MudTextField T="string" @bind-Text="@this.inputHistory" Validation="@this.ValidateHistory" Label="@T("Previous conversation")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Provide the previous conversation, e.g., the last e-mail, the last chat, etc.")" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.INPUT_TEXT"/>
|
||||
</MudPaper>
|
||||
}
|
||||
|
||||
<MudTextField T="string" @bind-Text="@this.inputGreeting" Label="@T("(Optional) The greeting phrase to use")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.USER" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Placeholder="@T("Dear Colleagues")" Class="mb-3"/>
|
||||
<DebouncedTextField @bind-Text="@this.inputBulletPoints" ValidationFunc="@this.ValidateBulletPoints" Icon="@AppIcons.LIST" Label="@T("Your bullet points")" Lines="6" MaxLines="12" Attributes="@USER_INPUT_ATTRIBUTES" HelpText="@T("Bullet list the content of the e-mail roughly. Use dashes (-) to separate the items.")" DebounceTime="TimeSpan.FromSeconds(1)" WhenTextCanged="@this.OnContentChanged" Placeholder="@PLACEHOLDER_BULLET_POINTS"/>
|
||||
<MudSelect T="string" Label="@T("(Optional) Are any of your points particularly important?")" MultiSelection="@true" @bind-SelectedValues="@this.selectedFoci" Variant="Variant.Outlined" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LIST">
|
||||
<DebouncedTextField @bind-Text="@this.inputBulletPoints" ValidationFunc="@this.ValidateBulletPoints" Icon="@AppIcons.LIST" Label="@TA("Your bullet points")" Lines="6" MaxLines="12" Attributes="@USER_INPUT_ATTRIBUTES" HelpText="@TA("Bullet list the content of the e-mail roughly. Use dashes (-) to separate the items.")" DebounceTime="TimeSpan.FromSeconds(1)" WhenTextCanged="@this.OnContentChanged" Placeholder="@PLACEHOLDER_BULLET_POINTS"/>
|
||||
<MudSelect T="string" Label="@TA("(Optional) Are any of your points particularly important?")" MultiSelection="@true" @bind-SelectedValues="@this.selectedFoci" Variant="Variant.Outlined" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LIST">
|
||||
@foreach (var contentLine in this.bulletPointsLines)
|
||||
{
|
||||
<MudSelectItem T="string" Value="@contentLine">
|
||||
@@ -19,7 +19,7 @@
|
||||
</MudSelectItem>
|
||||
}
|
||||
</MudSelect>
|
||||
<MudTextField T="string" @bind-Text="@this.inputName" Label="@T("(Optional) Your name for the closing salutation")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.USER" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Your name for the closing salutation of your e-mail.")" Class="mb-3"/>
|
||||
<MudTextField T="string" @bind-Text="@this.inputName" Label="@TA("(Optional) Your name for the closing salutation")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.USER" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Your name for the closing salutation of your e-mail.")" Class="mb-3"/>
|
||||
<EnumSelection T="WritingStyles" NameFunc="@(style => style.Name)" @bind-Value="@this.selectedWritingStyle" Icon="@AppIcons.WRITING_STYLE" Label="@T("Select the writing style")" ValidateSelection="@this.ValidateWritingStyle"/>
|
||||
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelecting)" @bind-Value="@this.selectedTargetLanguage" ValidateSelection="@this.ValidateTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Target language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" />
|
||||
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
|
||||
@@ -12,7 +12,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
|
||||
protected override string Title => T("E-Mail");
|
||||
|
||||
protected override string Description => T("Provide a list of bullet points and some basic information for an e-mail. The assistant will generate an e-mail based on that input.");
|
||||
protected override string Description => TA("Provide a list of bullet points and some basic information for an e-mail. The assistant will generate an e-mail based on that input.");
|
||||
|
||||
// The prompt of this assistant describes an automated system which only writes the email, so the chat gets a prompt of its own, which keeps the settings of the email:
|
||||
protected override ChatSystemPromptChoice ChatSystemPrompt => ChatSystemPromptChoice.Custom(this.CreateChatSystemPrompt);
|
||||
@@ -150,12 +150,12 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
private string? ValidateBulletPoints(string content)
|
||||
{
|
||||
if(string.IsNullOrWhiteSpace(content))
|
||||
return T("Please provide some content for the e-mail.");
|
||||
return TA("Please provide some content for the e-mail.");
|
||||
|
||||
var lines = content.Split('\n', StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (var line in lines)
|
||||
if(!line.TrimStart().StartsWith('-'))
|
||||
return T("Please start each line of your content list with a dash (-) to create a bullet point list.");
|
||||
return TA("Please start each line of your content list with a dash (-) to create a bullet point list.");
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
private string? ValidateTargetLanguage(CommonLanguages language)
|
||||
{
|
||||
if(language is CommonLanguages.AS_IS)
|
||||
return T("Please select a target language for the e-mail.");
|
||||
return TA("Please select a target language for the e-mail.");
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
private string? ValidateCustomLanguage(string language)
|
||||
{
|
||||
if(this.selectedTargetLanguage == CommonLanguages.OTHER && string.IsNullOrWhiteSpace(language))
|
||||
return T("Please provide a custom language.");
|
||||
return TA("Please provide a custom language.");
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
private string? ValidateWritingStyle(WritingStyles style)
|
||||
{
|
||||
if(style == WritingStyles.NONE)
|
||||
return T("Please select a writing style for the e-mail.");
|
||||
return TA("Please select a writing style for the e-mail.");
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public partial class AssistantEMail : AssistantBaseCore<SettingsDialogWritingEMa
|
||||
private string? ValidateHistory(string history)
|
||||
{
|
||||
if(this.provideHistory && string.IsNullOrWhiteSpace(history))
|
||||
return T("Please provide some history for the e-mail.");
|
||||
return TA("Please provide some history for the e-mail.");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user