feat(knowledge): Add tag_id support for knowledge creation and file uploads
- Introduced tag_id parameter in various knowledge-related API functions to allow categorization of knowledge entries. - Updated frontend components to handle tag_id during knowledge creation and file uploads. - Enhanced UI store to manage the selected tag ID for better user experience in categorizing knowledge.
This commit is contained in:
@@ -823,9 +823,11 @@ const handleDocFileChange = async (event: Event) => {
|
||||
}))
|
||||
|
||||
try {
|
||||
// 获取当前选中的分类ID
|
||||
const tagIdToUpload = uiStore.selectedTagId !== '__untagged__' ? uiStore.selectedTagId : undefined
|
||||
await uploadKnowledgeFile(
|
||||
kbId,
|
||||
{ file },
|
||||
{ file, tag_id: tagIdToUpload },
|
||||
(progressEvent: any) => {
|
||||
if (progressEvent.total) {
|
||||
progress = Math.round((progressEvent.loaded * 100) / progressEvent.total)
|
||||
@@ -1067,9 +1069,11 @@ const handleDocFolderChange = async (event: Event) => {
|
||||
}))
|
||||
|
||||
try {
|
||||
// 获取当前选中的分类ID
|
||||
const tagIdToUpload = uiStore.selectedTagId !== '__untagged__' ? uiStore.selectedTagId : undefined
|
||||
await uploadKnowledgeFile(
|
||||
kbId,
|
||||
{ file, fileName },
|
||||
{ file, fileName, tag_id: tagIdToUpload },
|
||||
(progressEvent: any) => {
|
||||
if (progressEvent?.total) {
|
||||
progress = Math.round((progressEvent.loaded * 100) / progressEvent.total)
|
||||
|
||||
Reference in New Issue
Block a user