mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-15 03:13:48 +00:00
Ensure unique names for embedding methods and retrieval processes
This commit is contained in:
3 files changed
+23
No files matched your search
@@ -39,6 +39,12 @@ public partial class EmbeddingMethodDialog : ComponentBase
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string DataLink { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The embedding method names that are already used. The user must choose a unique name.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public IReadOnlyList<string> UsedEmbeddingMethodNames { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,12 @@ public partial class RetrievalProcessDialog : ComponentBase
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public IReadOnlyList<EmbeddingInfo> AvailableEmbeddings { get; set; } = new List<EmbeddingInfo>();
|
||||
|
||||
/// <summary>
|
||||
/// The retrieval process names that are already used. The user must choose a unique name.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public IReadOnlyList<string> UsedRetrievalProcessNames { get; set; } = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user