Skip to content

Commit 9af1fc1

Browse files
committed
feat: 支持复制知识库时指定任务ID
1 parent bebeb2a commit 9af1fc1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

client/knowledgebase.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ type HybridSearchResponse struct {
136136
}
137137

138138
type CopyKnowledgeBaseRequest struct {
139+
TaskID string `json:"task_id,omitempty"`
139140
SourceID string `json:"source_id"`
140141
TargetID string `json:"target_id"`
141142
}

internal/handler/knowledgebase.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ func (h *KnowledgeBaseHandler) DeleteKnowledgeBase(c *gin.Context) {
331331
}
332332

333333
type CopyKnowledgeBaseRequest struct {
334+
TaskID string `json:"task_id"`
334335
SourceID string `json:"source_id" binding:"required"`
335336
TargetID string `json:"target_id"`
336337
}
@@ -372,8 +373,11 @@ func (h *KnowledgeBaseHandler) CopyKnowledgeBase(c *gin.Context) {
372373
return
373374
}
374375

375-
// Generate task ID
376-
taskID := uuid.New().String()
376+
// Generate task ID if not provided
377+
taskID := req.TaskID
378+
if taskID == "" {
379+
taskID = uuid.New().String()
380+
}
377381

378382
// Create KB clone payload
379383
payload := types.KBClonePayload{

0 commit comments

Comments
 (0)