add create vector knowledge
This commit is contained in:
parent
2af2b7d74c
commit
37e87c934e
|
|
@ -8,7 +8,7 @@ public interface IKnowledgeService
|
|||
Task<IEnumerable<string>> GetVectorCollections();
|
||||
Task<IEnumerable<VectorSearchResult>> SearchVectorKnowledge(string query, string collectionName, VectorSearchOptions options);
|
||||
Task FeedVectorKnowledge(string collectionName, KnowledgeCreationModel model);
|
||||
Task<StringIdPagedItems<VectorSearchResult>> GetVectorCollectionData(string collectionName, VectorFilter filter);
|
||||
Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter);
|
||||
Task<bool> DeleteVectorCollectionData(string collectionName, string id);
|
||||
Task<bool> CreateVectorCollectionData(string collectionName, VectorCreateModel create);
|
||||
Task<bool> UpdateVectorCollectionData(string collectionName, VectorUpdateModel update);
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ public class KnowledgeBaseController : ControllerBase
|
|||
return results.Select(x => VectorKnowledgeViewModel.From(x)).ToList();
|
||||
}
|
||||
|
||||
[HttpPost("/knowledge/vector/{collection}/data")]
|
||||
public async Task<StringIdPagedItems<VectorKnowledgeViewModel>> GetVectorCollectionData([FromRoute] string collection, [FromBody] VectorFilter filter)
|
||||
[HttpPost("/knowledge/vector/{collection}/page")]
|
||||
public async Task<StringIdPagedItems<VectorKnowledgeViewModel>> GetPagedVectorCollectionData([FromRoute] string collection, [FromBody] VectorFilter filter)
|
||||
{
|
||||
var data = await _knowledgeService.GetVectorCollectionData(collection, filter);
|
||||
var data = await _knowledgeService.GetPagedVectorCollectionData(collection, filter);
|
||||
var items = data.Items?.Select(x => VectorKnowledgeViewModel.From(x))?
|
||||
.ToList() ?? new List<VectorKnowledgeViewModel>();
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class KnowledgeBasePlugin : IBotSharpPlugin
|
|||
{
|
||||
SubMenu = new List<PluginMenuDef>
|
||||
{
|
||||
new PluginMenuDef("Q & A", link: "page/knowledge-base/qna"),
|
||||
new PluginMenuDef("Q & A", link: "page/knowledge-base/question-answer"),
|
||||
new PluginMenuDef("Relations", link: "page/knowledge-base/relations")
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public partial class KnowledgeService
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<StringIdPagedItems<VectorSearchResult>> GetVectorCollectionData(string collectionName, VectorFilter filter)
|
||||
public async Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue