Refactoring Services ...
This commit is contained in:
@@ -447,12 +447,14 @@ namespace xAiApi.Providers
|
||||
/// <param name="fileName"></param>
|
||||
/// <param name="scope"></param>
|
||||
/// <param name="userInfo"></param>
|
||||
/// <param name="connectionId"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns>Count of Removed Vectors</returns>
|
||||
public async Task<int> RemoveDocumentAsync(
|
||||
string fileName,
|
||||
XAiKnowledgeScopeDescriptor scope = null,
|
||||
XUserClaimsInfoDto userInfo = null,
|
||||
string connectionId = null,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
@@ -479,8 +481,28 @@ namespace xAiApi.Providers
|
||||
//
|
||||
// Remove Files using ...
|
||||
var file = await fileProvider.FindOne(
|
||||
x => x.FileName ==
|
||||
)
|
||||
x => x.FileName
|
||||
.Equals(
|
||||
fileName,
|
||||
StringComparison.InvariantCultureIgnoreCase) &&
|
||||
x.OwnerId
|
||||
.Equals(
|
||||
userInfo.UserId,
|
||||
StringComparison.InvariantCultureIgnoreCase),
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
if (!file.IsNullOrDefault())
|
||||
{
|
||||
//
|
||||
await fileProvider.Remove(
|
||||
id: file.Id,
|
||||
userInfo: userInfo,
|
||||
connectionId: connectionId,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user