|
1 | | -using BotSharp.Abstraction.Graph.Models; |
2 | | -using BotSharp.Abstraction.Graph.Options; |
3 | | -using BotSharp.Abstraction.Knowledges.Filters; |
| 1 | +using BotSharp.Abstraction.Knowledges.Models; |
4 | 2 | using BotSharp.Abstraction.Knowledges.Options; |
5 | | -using BotSharp.Abstraction.Knowledges.Responses; |
6 | | -using BotSharp.Abstraction.VectorStorage.Models; |
7 | | -using BotSharp.Abstraction.VectorStorage.Options; |
8 | 3 |
|
9 | 4 | namespace BotSharp.Abstraction.Knowledges; |
10 | 5 |
|
11 | 6 | public interface IKnowledgeService |
12 | 7 | { |
13 | | - #region Vector |
14 | | - //Task<bool> ExistVectorCollection(string collectionName); |
15 | | - //Task<bool> CreateVectorCollection(string collectionName, string collectionType, VectorCollectionCreateOptions options); |
16 | | - //Task<bool> DeleteVectorCollection(string collectionName); |
17 | | - //Task<IEnumerable<VectorCollectionConfig>> GetVectorCollections(string? type = null); |
18 | | - //Task<VectorCollectionDetails?> GetVectorCollectionDetails(string collectionName); |
19 | | - //Task<IEnumerable<VectorSearchResult>> SearchVectorKnowledge(string query, string collectionName, VectorSearchOptions options); |
20 | | - //Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter); |
21 | | - //Task<IEnumerable<VectorCollectionData>> GetVectorCollectionData(string collectionName, IEnumerable<string> ids, VectorQueryOptions? options = null); |
22 | | - //Task<bool> DeleteVectorCollectionData(string collectionName, string id); |
23 | | - //Task<bool> DeleteVectorCollectionAllData(string collectionName); |
24 | | - //Task<bool> CreateVectorCollectionData(string collectionName, VectorCreateModel create); |
25 | | - //Task<bool> UpdateVectorCollectionData(string collectionName, VectorUpdateModel update); |
26 | | - //Task<bool> UpsertVectorCollectionData(string collectionName, VectorUpdateModel update); |
27 | | - #endregion |
| 8 | + string KnowledgeType { get; } |
28 | 9 |
|
29 | | - //#region Document |
30 | | - ///// <summary> |
31 | | - ///// Save documents and their contents to knowledgebase |
32 | | - ///// </summary> |
33 | | - ///// <param name="collectionName"></param> |
34 | | - ///// <param name="files"></param> |
35 | | - ///// <param name="option"></param> |
36 | | - ///// <returns></returns> |
37 | | - //Task<UploadKnowledgeResponse> UploadDocumentsToKnowledge(string collectionName, IEnumerable<ExternalFileModel> files, KnowledgeFileHandleOptions? options = null); |
38 | | - ///// <summary> |
39 | | - ///// Save document content to knowledgebase without saving the document |
40 | | - ///// </summary> |
41 | | - ///// <param name="collectionName"></param> |
42 | | - ///// <param name="fileName"></param> |
43 | | - ///// <param name="fileSource"></param> |
44 | | - ///// <param name="contents"></param> |
45 | | - ///// <param name="refData"></param> |
46 | | - ///// <returns></returns> |
47 | | - //Task<bool> ImportDocumentContentToKnowledge(string collectionName, string fileName, string fileSource, IEnumerable<string> contents, |
48 | | - // DocMetaRefData? refData = null, Dictionary<string, VectorPayloadValue>? payload = null); |
49 | | - ///// <summary> |
50 | | - ///// Delete one document and its related knowledge in the collection |
51 | | - ///// </summary> |
52 | | - ///// <param name="collectionName"></param> |
53 | | - ///// <param name="fileId"></param> |
54 | | - ///// <returns></returns> |
55 | | - //Task<bool> DeleteKnowledgeDocument(string collectionName, Guid fileId); |
56 | | - ///// <summary> |
57 | | - ///// Delete all documents and their related knowledge in the collection |
58 | | - ///// </summary> |
59 | | - ///// <param name="collectionName"></param> |
60 | | - ///// <param name="filter"></param> |
61 | | - ///// <returns></returns> |
62 | | - //Task<bool> DeleteKnowledgeDocuments(string collectionName, KnowledgeFileFilter filter); |
63 | | - //Task<PagedItems<KnowledgeFileModel>> GetPagedKnowledgeDocuments(string collectionName, KnowledgeFileFilter filter); |
64 | | - //Task<FileBinaryDataModel> GetKnowledgeDocumentBinaryData(string collectionName, Guid fileId); |
65 | | - //#endregion |
| 10 | + #region Collection |
| 11 | + Task<bool> ExistCollection(string collectionName, KnowledgeCollectionOptions options) |
| 12 | + => Task.FromResult(false); |
| 13 | + Task<bool> CreateCollection(string collectionName, CollectionCreateOptions options) |
| 14 | + => Task.FromResult(false); |
| 15 | + Task<bool> DeleteCollection(string collectionName, KnowledgeCollectionOptions options) |
| 16 | + => Task.FromResult(false); |
| 17 | + Task<IEnumerable<KnowledgeCollectionConfig>> GetCollections(KnowledgeCollectionOptions options) |
| 18 | + => Task.FromResult(Enumerable.Empty<KnowledgeCollectionConfig>()); |
| 19 | + Task<KnowledgeCollectionDetails?> GetCollectionDetails(string collectionName, KnowledgeCollectionOptions options) |
| 20 | + => Task.FromResult<KnowledgeCollectionDetails?>(null); |
| 21 | + #endregion |
66 | 22 |
|
67 | | - //#region Snapshot |
68 | | - //Task<IEnumerable<VectorCollectionSnapshot>> GetVectorCollectionSnapshots(string collectionName); |
69 | | - //Task<VectorCollectionSnapshot?> CreateVectorCollectionSnapshot(string collectionName); |
70 | | - //Task<BinaryData> DownloadVectorCollectionSnapshot(string collectionName, string snapshotFileName); |
71 | | - //Task<bool> RecoverVectorCollectionFromSnapshot(string collectionName, string snapshotFileName, BinaryData snapshotData); |
72 | | - //Task<bool> DeleteVectorCollectionSnapshot(string collectionName, string snapshotName); |
73 | | - //#endregion |
| 23 | + #region Data |
| 24 | + Task<IEnumerable<KnowledgeExecuteResult>> ExecuteQuery(string query, string collectionName, KnowledgeExecuteOptions options) |
| 25 | + => Task.FromResult(Enumerable.Empty<KnowledgeExecuteResult>()); |
| 26 | + Task<StringIdPagedItems<KnowledgeCollectionData>> GetPagedCollectionData(string collectionName, KnowledgeFilter filter) |
| 27 | + => Task.FromResult(new StringIdPagedItems<KnowledgeCollectionData>()); |
| 28 | + Task<IEnumerable<KnowledgeCollectionData>> GetCollectionData(string collectionName, IEnumerable<string> ids, KnowledgeQueryOptions? options = null) |
| 29 | + => Task.FromResult(Enumerable.Empty<KnowledgeCollectionData>()); |
| 30 | + Task<bool> DeleteCollectionData(string collectionName, string id, KnowledgeCollectionOptions? options) |
| 31 | + => Task.FromResult(false); |
| 32 | + Task<bool> DeleteCollectionData(string collectionName, KnowledgeCollectionOptions? options) |
| 33 | + => Task.FromResult(false); |
| 34 | + Task<bool> CreateCollectionData(string collectionName, KnowledgeCreateModel create) |
| 35 | + => Task.FromResult(false); |
| 36 | + Task<bool> UpdateCollectionData(string collectionName, KnowledgeUpdateModel update) |
| 37 | + => Task.FromResult(false); |
| 38 | + Task<bool> UpsertCollectionData(string collectionName, KnowledgeUpdateModel update) |
| 39 | + => Task.FromResult(false); |
| 40 | + #endregion |
74 | 41 |
|
75 | | - //#region Index |
76 | | - //Task<SuccessFailResponse<string>> CreateVectorCollectionPayloadIndexes(string collectionName, IEnumerable<CollectionIndexOptions> options); |
77 | | - //Task<SuccessFailResponse<string>> DeleteVectorCollectionPayloadIndexes(string collectionName, IEnumerable<CollectionIndexOptions> options); |
78 | | - //#endregion |
| 42 | + #region Index |
| 43 | + Task<SuccessFailResponse<string>> CreateIndexes(string collectionName, KnowledgeIndexOptions options) |
| 44 | + => Task.FromResult(new SuccessFailResponse<string>()); |
| 45 | + Task<SuccessFailResponse<string>> DeleteIndexes(string collectionName, KnowledgeIndexOptions options) |
| 46 | + => Task.FromResult(new SuccessFailResponse<string>()); |
| 47 | + #endregion |
79 | 48 |
|
| 49 | + #region Snapshot |
| 50 | + Task<IEnumerable<KnowledgeCollectionSnapshot>> GetCollectionSnapshots(string collectionName, KnowledgeSnapshotOptions? options = null) |
| 51 | + => Task.FromResult(Enumerable.Empty<KnowledgeCollectionSnapshot>()); |
| 52 | + Task<KnowledgeCollectionSnapshot?> CreateCollectionSnapshot(string collectionName, KnowledgeSnapshotOptions? options = null) |
| 53 | + => Task.FromResult<KnowledgeCollectionSnapshot?>(null); |
| 54 | + Task<BinaryData> DownloadCollectionSnapshot(string collectionName, string snapshotFileName, KnowledgeSnapshotOptions? options = null) |
| 55 | + => Task.FromResult(new BinaryData(Array.Empty<byte>())); |
| 56 | + Task<bool> RecoverCollectionFromSnapshot(string collectionName, string snapshotFileName, BinaryData snapshotData, KnowledgeSnapshotOptions? options = null) |
| 57 | + => Task.FromResult(false); |
| 58 | + Task<bool> DeleteCollectionSnapshot(string collectionName, string snapshotName, KnowledgeSnapshotOptions? options = null) |
| 59 | + => Task.FromResult(false); |
| 60 | + #endregion |
80 | 61 | } |
0 commit comments