mirror of
				https://github.com/MindWorkAI/AI-Studio.git
				synced 2025-10-31 10:20:21 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			213 lines
		
	
	
		
			9.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			213 lines
		
	
	
		
			9.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| @using AIStudio.Assistants.ERI
 | |
| @using MudExtensions
 | |
| <MudDialog>
 | |
|     <DialogContent>
 | |
|         <MudForm @ref="@this.form" @bind-IsValid="@this.dataIsValid" @bind-Errors="@this.dataIssues">
 | |
| 
 | |
|             <MudText Typo="Typo.h5" Class="mb-3">
 | |
|                 General Information
 | |
|             </MudText>
 | |
| 
 | |
|             <MudText Typo="Typo.body1" Class="mb-3">
 | |
|                 Please provide some general information about your retrieval process first. This data may be
 | |
|                 displayed to the users.
 | |
|             </MudText>
 | |
|             
 | |
|             @* ReSharper disable once CSharpWarnings::CS8974 *@
 | |
|             <MudTextField
 | |
|                 T="string"
 | |
|                 @bind-Text="@this.DataName"
 | |
|                 Label="Retrieval Process Name"
 | |
|                 HelperText="The name of your retrieval process."
 | |
|                 Class="mb-3"
 | |
|                 Adornment="Adornment.Start"
 | |
|                 AdornmentIcon="@Icons.Material.Filled.Label"
 | |
|                 AdornmentColor="Color.Info"
 | |
|                 Validation="@this.ValidateName"
 | |
|                 Counter="26"
 | |
|                 MaxLength="26"
 | |
|                 Immediate="@true"
 | |
|                 UserAttributes="@SPELLCHECK_ATTRIBUTES"
 | |
|             />
 | |
| 
 | |
|             @* ReSharper disable once CSharpWarnings::CS8974 *@
 | |
|             <MudTextField
 | |
|                 T="string"
 | |
|                 @bind-Text="@this.DataDescription"
 | |
|                 Label="Retrieval Process Description"
 | |
|                 HelperText="A short description of the retrieval process."
 | |
|                 Lines="3"
 | |
|                 AutoGrow="@true"
 | |
|                 MaxLines="6"
 | |
|                 Immediate="@true"
 | |
|                 Variant="Variant.Outlined"
 | |
|                 Class="mb-3"
 | |
|                 Adornment="Adornment.Start"
 | |
|                 AdornmentIcon="@Icons.Material.Filled.Extension"
 | |
|                 AdornmentColor="Color.Info"
 | |
|                 Validation="@this.ValidateDescription"
 | |
|                 UserAttributes="@SPELLCHECK_ATTRIBUTES"
 | |
|             />
 | |
| 
 | |
|             @* ReSharper disable once CSharpWarnings::CS8974 *@
 | |
|             <MudTextField
 | |
|                 T="string"
 | |
|                 @bind-Text="@this.DataLink"
 | |
|                 Label="Retrieval Process Link"
 | |
|                 HelperText="A link to the retrieval process, e.g., the source code, the paper, it's Wikipedia page, etc. Make sense for common retrieval processes. Leave empty if not applicable."
 | |
|                 Class="mb-6"
 | |
|                 Adornment="Adornment.Start"
 | |
|                 AdornmentIcon="@Icons.Material.Filled.Link"
 | |
|                 AdornmentColor="Color.Info"
 | |
|                 UserAttributes="@SPELLCHECK_ATTRIBUTES"
 | |
|             />
 | |
| 
 | |
|             <MudText Typo="Typo.h5" Class="mb-3">
 | |
|                 Retrieval Process Parameters
 | |
|             </MudText>
 | |
| 
 | |
|             <MudText Typo="Typo.body1" Class="mb-3">
 | |
|                 You may want to parameterize your retrieval process. However, this is optional. You can specify any
 | |
|                 parameters that can be set by the user or the system during the call. Nevertheless, you should use
 | |
|                 sensible default values in your code so that users are not forced to set the parameters manually.
 | |
|             </MudText>
 | |
|             
 | |
|             <MudStack Row="@true" Spacing="6" AlignItems="AlignItems.Start" StretchItems="StretchItems.None">
 | |
|                 @* The left side of the stack is another stack to show the list *@
 | |
|                 <MudStack Row="@false" AlignItems="AlignItems.Start" StretchItems="StretchItems.None">
 | |
|                     @if (this.retrievalParameters.Count > 0)
 | |
|                     {
 | |
|                         <MudList T="RetrievalParameter" Class="mb-1" @bind-SelectedValue="@this.selectedParameter">
 | |
|                             @foreach (var parameter in this.retrievalParameters)
 | |
|                             {
 | |
|                                 <MudListItem T="RetrievalParameter" Icon="@Icons.Material.Filled.Tune" Value="@parameter">
 | |
|                                     @parameter.Name
 | |
|                                 </MudListItem>
 | |
|                             }
 | |
|                         </MudList>
 | |
|                     }
 | |
|                     <MudButton OnClick="@this.AddRetrievalProcessParameter" Variant="Variant.Filled" Color="Color.Primary" Class="mt-1">
 | |
|                         Add Parameter
 | |
|                     </MudButton>
 | |
|                 </MudStack>
 | |
|                 
 | |
|                 @* The right side of the stack is another stack to display the parameter's data *@
 | |
|                 <MudStack Row="@false" AlignItems="AlignItems.Stretch" StretchItems="StretchItems.End" Class="pa-3 mb-8 border-solid border rounded-lg">
 | |
|                     @if (this.selectedParameter is null)
 | |
|                     {
 | |
|                         @if(this.retrievalParameters.Count == 0)
 | |
|                         {
 | |
|                             <MudText>
 | |
|                                 Add a parameter first, then select it to edit.
 | |
|                             </MudText>
 | |
|                         }
 | |
|                         else
 | |
|                         {
 | |
|                             <MudText>
 | |
|                                 Select a parameter to show and edit it.
 | |
|                             </MudText>
 | |
|                         }
 | |
|                     }
 | |
|                     else
 | |
|                     {
 | |
|                         @* ReSharper disable once CSharpWarnings::CS8974 *@
 | |
|                         <MudTextField
 | |
|                             T="string"
 | |
|                             @bind-Text="@this.selectedParameter.Name"
 | |
|                             Label="Parameter Name"
 | |
|                             HelperText="The parameter name. It must be unique within the retrieval process."
 | |
|                             Class="mb-3"
 | |
|                             Adornment="Adornment.Start"
 | |
|                             AdornmentIcon="@Icons.Material.Filled.Label"
 | |
|                             AdornmentColor="Color.Info"
 | |
|                             Counter="26"
 | |
|                             MaxLength="26"
 | |
|                             Validation="@this.ValidateParameterName"
 | |
|                             Immediate="@true"
 | |
|                             UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
 | |
| 
 | |
|                         @* ReSharper disable once CSharpWarnings::CS8974 *@
 | |
|                         <MudTextField
 | |
|                             T="string"
 | |
|                             @bind-Text="@this.selectedParameter.Description"
 | |
|                             Label="Parameter Description"
 | |
|                             HelperText="A short description of the parameter. What data type is it? What is it used for? What are the possible values?"
 | |
|                             Lines="3"
 | |
|                             AutoGrow="@true"
 | |
|                             MaxLines="6"
 | |
|                             Immediate="@true"
 | |
|                             Variant="Variant.Outlined"
 | |
|                             Class="mb-3"
 | |
|                             Adornment="Adornment.Start"
 | |
|                             AdornmentIcon="@Icons.Material.Filled.Extension"
 | |
|                             AdornmentColor="Color.Info"
 | |
|                             Validation="@this.ValidateParameterDescription"
 | |
|                             UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
 | |
|                         
 | |
|                         <MudStack Row="@true">
 | |
|                             <MudButton OnClick="@this.RemoveRetrievalProcessParameter" Variant="Variant.Filled" Color="Color.Secondary">
 | |
|                                 Delete this parameter
 | |
|                             </MudButton>
 | |
|                         </MudStack>
 | |
|                         
 | |
|                     }
 | |
|                 </MudStack>    
 | |
|             </MudStack>
 | |
| 
 | |
|             <MudText Typo="Typo.h5" Class="mb-3">
 | |
|                 Embeddings
 | |
|             </MudText>
 | |
| 
 | |
|             @if(this.AvailableEmbeddings.Count == 0)
 | |
|             {
 | |
|                 <MudText Typo="Typo.body1" Class="mb-3">
 | |
|                     Currently, you have not defined any embedding methods. If your retrieval process does not require embedding, you can ignore this part.
 | |
|                     Otherwise, you can define one or more embedding methods in the previous view to assign them to your retrieval process here.
 | |
|                 </MudText>
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 <MudText Typo="Typo.body1" Class="mb-3">
 | |
|                     Here you can select which embedding methods are used for this retrieval process. Embeddings are optional;
 | |
|                     if your retrieval process works without embedding, you can ignore this part. You can only choose the embedding
 | |
|                     methods you have previously defined.
 | |
|                 </MudText>
 | |
| 
 | |
|                 <MudSelectExtended
 | |
|                     T="EmbeddingInfo"
 | |
|                     MultiSelection="@true"
 | |
|                     MultiSelectionTextFunc="@this.GetMultiSelectionText"
 | |
|                     SelectedValues="@this.DataEmbeddings"
 | |
|                     SelectedValuesChanged="@this.EmbeddingsChanged"
 | |
|                     Strict="@true"
 | |
|                     Margin="Margin.Dense"
 | |
|                     Label="Embeddings methods"
 | |
|                     ShrinkLabel="@true"
 | |
|                     Class="mb-3"
 | |
|                     Variant="Variant.Outlined"
 | |
|                     HelperText="Optional. Select the embedding methods that are used for this retrieval process.">
 | |
|                     @foreach (var embedding in this.AvailableEmbeddings)
 | |
|                     {
 | |
|                         <MudSelectItemExtended Value="@embedding">
 | |
|                             @embedding.EmbeddingName
 | |
|                         </MudSelectItemExtended>
 | |
|                     }
 | |
|                 </MudSelectExtended>
 | |
|             }
 | |
|         </MudForm>
 | |
|         <Issues IssuesData="@this.dataIssues"/>
 | |
|     </DialogContent>
 | |
|     <DialogActions>
 | |
|         <MudButton OnClick="@this.Cancel" Variant="Variant.Filled">Cancel</MudButton>
 | |
|         <MudButton OnClick="@this.Store" Variant="Variant.Filled" Color="Color.Primary">
 | |
|             @if(this.IsEditing)
 | |
|             {
 | |
|                 @:Update
 | |
|             }
 | |
|             else
 | |
|             {
 | |
|                 @:Add
 | |
|             }
 | |
|         </MudButton>
 | |
|     </DialogActions>
 | |
| </MudDialog> |