mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 16:09:40 +00:00
made the chunking process more robust
This commit is contained in:
1 parent
95ca74809b
commit
1bf9328fb9
9 files changed
+239
-37
No files matched your search
@@ -73,6 +73,9 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
|
||||
[Parameter]
|
||||
public string DataTokenizerPath { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public int DataTokenLimit { get; set; } = EmbeddingProvider.DEFAULT_TOKEN_LIMIT;
|
||||
|
||||
[Inject]
|
||||
private RustService RustService { get; init; } = null!;
|
||||
@@ -148,6 +151,7 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
IsEnterpriseConfiguration = false,
|
||||
EnterpriseConfigurationPluginId = Guid.Empty,
|
||||
TokenizerPath = this.dataFilePath,
|
||||
TokenLimit = this.DataTokenLimit,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -277,6 +281,14 @@ public partial class EmbeddingProviderDialog : MSGComponentBase, ISecretId
|
||||
return null;
|
||||
}
|
||||
|
||||
private string? ValidateTokenLimit(int tokenLimit)
|
||||
{
|
||||
if (tokenLimit < 1)
|
||||
return T("Please enter a token limit greater than 0.");
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void Cancel() => this.MudDialog.Cancel();
|
||||
|
||||
private async Task OnAPIKeyChanged(string apiKey)
|
||||
|
||||
Reference in new issue
Block a user