Improved naming

This commit is contained in:
Thorsten Sommer 2024-08-22 15:38:44 +02:00
parent adbb1cb0c7
commit 84457f1001
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 6 additions and 6 deletions

View File

@ -9,7 +9,7 @@
</MudPaper> </MudPaper>
} }
<MudTextField T="string" @bind-Text="@this.inputSalutation" Label="(Optional) The salutation to use" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Placeholder="Dear Colleagues" Class="mb-3"/> <MudTextField T="string" @bind-Text="@this.inputGreeting" Label="(Optional) The greeting phrase to use" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Placeholder="Dear Colleagues" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputBulletPoints" Validation="@this.ValidateBulletPoints" AdornmentIcon="@Icons.Material.Filled.ListAlt" Adornment="Adornment.Start" Label="Your bullet points" Variant="Variant.Outlined" Lines="6" AutoGrow="@true" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="Bullet list the content of the e-mail roughly. Use dashes (-) to separate the items." Immediate="@false" DebounceInterval="1_000" OnDebounceIntervalElapsed="@this.OnContentChanged" Placeholder="@PLACEHOLDER_BULLET_POINTS"/> <MudTextField T="string" @bind-Text="@this.inputBulletPoints" Validation="@this.ValidateBulletPoints" AdornmentIcon="@Icons.Material.Filled.ListAlt" Adornment="Adornment.Start" Label="Your bullet points" Variant="Variant.Outlined" Lines="6" AutoGrow="@true" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="Bullet list the content of the e-mail roughly. Use dashes (-) to separate the items." Immediate="@false" DebounceInterval="1_000" OnDebounceIntervalElapsed="@this.OnContentChanged" Placeholder="@PLACEHOLDER_BULLET_POINTS"/>
<MudSelect T="string" Label="(Optional) Are any of your points particularly important?" MultiSelection="@true" @bind-SelectedValues="@this.selectedFoci" Variant="Variant.Outlined" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.ListAlt"> <MudSelect T="string" Label="(Optional) Are any of your points particularly important?" MultiSelection="@true" @bind-SelectedValues="@this.selectedFoci" Variant="Variant.Outlined" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.ListAlt">
@foreach (var contentLine in this.bulletPointsLines) @foreach (var contentLine in this.bulletPointsLines)
@ -17,7 +17,7 @@
<MudSelectItem T="string" Value="@contentLine">@contentLine</MudSelectItem> <MudSelectItem T="string" Value="@contentLine">@contentLine</MudSelectItem>
} }
</MudSelect> </MudSelect>
<MudTextField T="string" @bind-Text="@this.inputName" Label="(Optional) Your name" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="Your name for the greeting of your e-mail." Class="mb-3"/> <MudTextField T="string" @bind-Text="@this.inputName" Label="(Optional) Your name for the closing salutation" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="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="@Icons.Material.Filled.Edit" Label="Select the writing style" ValidateSelection="@this.ValidateWritingStyle"/> <EnumSelection T="WritingStyles" NameFunc="@(style => style.Name())" @bind-Value="@this.selectedWritingStyle" Icon="@Icons.Material.Filled.Edit" Label="Select the writing style" ValidateSelection="@this.ValidateWritingStyle"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelecting())" @bind-Value="@this.selectedTargetLanguage" ValidateSelection="@this.ValidateTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="Target language" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="Custom target language" /> <EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelecting())" @bind-Value="@this.selectedTargetLanguage" ValidateSelection="@this.ValidateTargetLanguage" Icon="@Icons.Material.Filled.Translate" Label="Target language" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="Custom target language" />
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/> <ProviderSelection @bind-ProviderSettings="@this.providerSettings" ValidateProvider="@this.ValidatingProvider"/>

View File

@ -47,7 +47,7 @@ public partial class AssistantEMail : AssistantBaseCore
this.selectedTargetLanguage = CommonLanguages.AS_IS; this.selectedTargetLanguage = CommonLanguages.AS_IS;
this.customTargetLanguage = string.Empty; this.customTargetLanguage = string.Empty;
this.selectedWritingStyle = WritingStyles.NONE; this.selectedWritingStyle = WritingStyles.NONE;
this.inputSalutation = string.Empty; this.inputGreeting = string.Empty;
} }
} }
@ -73,7 +73,7 @@ public partial class AssistantEMail : AssistantBaseCore
"""; """;
private WritingStyles selectedWritingStyle = WritingStyles.NONE; private WritingStyles selectedWritingStyle = WritingStyles.NONE;
private string inputSalutation = string.Empty; private string inputGreeting = string.Empty;
private string inputBulletPoints = string.Empty; private string inputBulletPoints = string.Empty;
private readonly List<string> bulletPointsLines = []; private readonly List<string> bulletPointsLines = [];
private IEnumerable<string> selectedFoci = new HashSet<string>(); private IEnumerable<string> selectedFoci = new HashSet<string>();
@ -175,8 +175,8 @@ public partial class AssistantEMail : AssistantBaseCore
private string SystemPromptGreeting() private string SystemPromptGreeting()
{ {
if(!string.IsNullOrWhiteSpace(this.inputSalutation)) if(!string.IsNullOrWhiteSpace(this.inputGreeting))
return $"Your greeting should consider the following formulation: {this.inputSalutation}."; return $"Your greeting should consider the following formulation: {this.inputGreeting}.";
return string.Empty; return string.Empty;
} }