diff --git a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs index 2effc79a..bf2476c6 100644 --- a/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs +++ b/app/MindWork AI Studio/Assistants/ERI/AssistantERI.razor.cs @@ -414,6 +414,7 @@ public partial class AssistantERI : AssistantBaseCore var dialogParameters = new DialogParameters { { x => x.IsEditing, false }, + { x => x.UsedEmbeddingMethodNames, this.embeddings.Select(n => n.EmbeddingName).ToList() }, }; var dialogReference = await this.DialogService.ShowAsync("Add Embedding Method", dialogParameters, DialogOptions.FULLSCREEN); @@ -435,6 +436,8 @@ public partial class AssistantERI : AssistantBaseCore { x => x.DataDescription, embeddingInfo.Description }, { x => x.DataUsedWhen, embeddingInfo.UsedWhen }, { x => x.DataLink, embeddingInfo.Link }, + + { x => x.UsedEmbeddingMethodNames, this.embeddings.Select(n => n.EmbeddingName).ToList() }, { x => x.IsEditing, true }, }; @@ -471,6 +474,7 @@ public partial class AssistantERI : AssistantBaseCore { { x => x.IsEditing, false }, { x => x.AvailableEmbeddings, this.embeddings }, + { x => x.UsedRetrievalProcessNames, this.retrievalProcesses.Select(n => n.Name).ToList() }, }; var dialogReference = await this.DialogService.ShowAsync("Add Retrieval Process", dialogParameters, DialogOptions.FULLSCREEN); @@ -495,6 +499,7 @@ public partial class AssistantERI : AssistantBaseCore { x => x.IsEditing, true }, { x => x.AvailableEmbeddings, this.embeddings }, + { x => x.UsedRetrievalProcessNames, this.retrievalProcesses.Select(n => n.Name).ToList() }, }; var dialogReference = await this.DialogService.ShowAsync("Edit Retrieval Process", dialogParameters, DialogOptions.FULLSCREEN); diff --git a/app/MindWork AI Studio/Dialogs/EmbeddingMethodDialog.razor.cs b/app/MindWork AI Studio/Dialogs/EmbeddingMethodDialog.razor.cs index feaf49a2..c2733fbc 100644 --- a/app/MindWork AI Studio/Dialogs/EmbeddingMethodDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/EmbeddingMethodDialog.razor.cs @@ -39,6 +39,12 @@ public partial class EmbeddingMethodDialog : ComponentBase /// [Parameter] public string DataLink { get; set; } = string.Empty; + + /// + /// The embedding method names that are already used. The user must choose a unique name. + /// + [Parameter] + public IReadOnlyList UsedEmbeddingMethodNames { get; set; } = new List(); /// /// Should the dialog be in editing mode? @@ -89,6 +95,9 @@ public partial class EmbeddingMethodDialog : ComponentBase if (name.Length > 26) return "The embedding name must not be longer than 26 characters."; + if (this.UsedEmbeddingMethodNames.Contains(name)) + return $"The embedding method name '{name}' is already used. Please choose a unique name."; + return null; } diff --git a/app/MindWork AI Studio/Dialogs/RetrievalProcessDialog.razor.cs b/app/MindWork AI Studio/Dialogs/RetrievalProcessDialog.razor.cs index 371677b0..df01a7c1 100644 --- a/app/MindWork AI Studio/Dialogs/RetrievalProcessDialog.razor.cs +++ b/app/MindWork AI Studio/Dialogs/RetrievalProcessDialog.razor.cs @@ -47,6 +47,12 @@ public partial class RetrievalProcessDialog : ComponentBase /// [Parameter] public IReadOnlyList AvailableEmbeddings { get; set; } = new List(); + + /// + /// The retrieval process names that are already used. The user must choose a unique name. + /// + [Parameter] + public IReadOnlyList UsedRetrievalProcessNames { get; set; } = new List(); /// /// Should the dialog be in editing mode? @@ -103,6 +109,9 @@ public partial class RetrievalProcessDialog : ComponentBase if (name.Length > 26) return "The retrieval process name must not be longer than 26 characters."; + if (this.UsedRetrievalProcessNames.Contains(name)) + return $"The retrieval process name '{name}' must be unique. Please choose a different name."; + return null; }