mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-06 03:29:40 +00:00
added retrieval with vector and bm25 search
This commit is contained in:
1 parent
c78a8f05ef
commit
010f35b08a
21 files changed
+775
-49
No files matched your search
@@ -905,22 +905,8 @@ public sealed partial class DataSourceEmbeddingService
|
||||
: null;
|
||||
}
|
||||
|
||||
private string GetCollectionName(string dataSourceName, string dataSourceId)
|
||||
{
|
||||
var safeId = dataSourceId
|
||||
.ToLowerInvariant()
|
||||
.Replace("-", string.Empty, StringComparison.Ordinal);
|
||||
|
||||
var safeName = new string(dataSourceName
|
||||
.ToLowerInvariant()
|
||||
.Where(c => c is >= 'a' and <= 'z' or >= '0' and <= '9')
|
||||
.Take(32)
|
||||
.ToArray());
|
||||
|
||||
safeName = string.IsNullOrWhiteSpace(safeName) ? "datasource" : safeName;
|
||||
|
||||
return $"rag_{safeName}_{safeId}";
|
||||
}
|
||||
private string GetCollectionName(string dataSourceName, string dataSourceId) =>
|
||||
DataSourceEmbeddingNames.GetCollectionName(dataSourceName, dataSourceId);
|
||||
|
||||
private string CreatePointId(string dataSourceId, string fingerprint, int chunkIndex) =>
|
||||
CreateStableGuid($"{dataSourceId}:chunk:{fingerprint}:{chunkIndex}");
|
||||
|
||||
Reference in new issue
Block a user