feat: 知识库朴素语义搜索(输入→检索→结果列表)
This commit is contained in:
@@ -52,6 +52,19 @@ const knowledgeService = {
|
||||
const resp = await http.get('/knowledge/grouped')
|
||||
return resp.data
|
||||
},
|
||||
|
||||
/**
|
||||
* 语义检索:输入一段文字,返回最相关的知识库条目
|
||||
* @param {string} queryText - 查询文字
|
||||
* @param {number} topK - 返回条数,默认 5
|
||||
*/
|
||||
async searchItems(queryText, topK = 5) {
|
||||
const resp = await http.post('/knowledge/search', {
|
||||
query: queryText,
|
||||
top_k: topK,
|
||||
})
|
||||
return resp.data
|
||||
},
|
||||
}
|
||||
|
||||
export default knowledgeService
|
||||
Reference in New Issue
Block a user