Skip to content

Commit 37e87c9

Browse files
author
Jicheng Lu
committed
add create vector knowledge
1 parent 2af2b7d commit 37e87c9

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Infrastructure/BotSharp.Abstraction/Knowledges/IKnowledgeService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public interface IKnowledgeService
88
Task<IEnumerable<string>> GetVectorCollections();
99
Task<IEnumerable<VectorSearchResult>> SearchVectorKnowledge(string query, string collectionName, VectorSearchOptions options);
1010
Task FeedVectorKnowledge(string collectionName, KnowledgeCreationModel model);
11-
Task<StringIdPagedItems<VectorSearchResult>> GetVectorCollectionData(string collectionName, VectorFilter filter);
11+
Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter);
1212
Task<bool> DeleteVectorCollectionData(string collectionName, string id);
1313
Task<bool> CreateVectorCollectionData(string collectionName, VectorCreateModel create);
1414
Task<bool> UpdateVectorCollectionData(string collectionName, VectorUpdateModel update);

src/Infrastructure/BotSharp.OpenAPI/Controllers/KnowledgeBaseController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ public async Task<IEnumerable<VectorKnowledgeViewModel>> SearchVectorKnowledge([
3939
return results.Select(x => VectorKnowledgeViewModel.From(x)).ToList();
4040
}
4141

42-
[HttpPost("/knowledge/vector/{collection}/data")]
43-
public async Task<StringIdPagedItems<VectorKnowledgeViewModel>> GetVectorCollectionData([FromRoute] string collection, [FromBody] VectorFilter filter)
42+
[HttpPost("/knowledge/vector/{collection}/page")]
43+
public async Task<StringIdPagedItems<VectorKnowledgeViewModel>> GetPagedVectorCollectionData([FromRoute] string collection, [FromBody] VectorFilter filter)
4444
{
45-
var data = await _knowledgeService.GetVectorCollectionData(collection, filter);
45+
var data = await _knowledgeService.GetPagedVectorCollectionData(collection, filter);
4646
var items = data.Items?.Select(x => VectorKnowledgeViewModel.From(x))?
4747
.ToList() ?? new List<VectorKnowledgeViewModel>();
4848

src/Plugins/BotSharp.Plugin.KnowledgeBase/KnowledgeBasePlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public bool AttachMenu(List<PluginMenuDef> menu)
3434
{
3535
SubMenu = new List<PluginMenuDef>
3636
{
37-
new PluginMenuDef("Q & A", link: "page/knowledge-base/qna"),
37+
new PluginMenuDef("Q & A", link: "page/knowledge-base/question-answer"),
3838
new PluginMenuDef("Relations", link: "page/knowledge-base/relations")
3939
}
4040
});

src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Get.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public async Task<IEnumerable<string>> GetVectorCollections()
1818
}
1919
}
2020

21-
public async Task<StringIdPagedItems<VectorSearchResult>> GetVectorCollectionData(string collectionName, VectorFilter filter)
21+
public async Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter)
2222
{
2323
try
2424
{

0 commit comments

Comments
 (0)