feat: 支持复制知识库时指定任务ID
This commit is contained in:
@@ -136,6 +136,7 @@ type HybridSearchResponse struct {
|
||||
}
|
||||
|
||||
type CopyKnowledgeBaseRequest struct {
|
||||
TaskID string `json:"task_id,omitempty"`
|
||||
SourceID string `json:"source_id"`
|
||||
TargetID string `json:"target_id"`
|
||||
}
|
||||
|
||||
@@ -331,6 +331,7 @@ func (h *KnowledgeBaseHandler) DeleteKnowledgeBase(c *gin.Context) {
|
||||
}
|
||||
|
||||
type CopyKnowledgeBaseRequest struct {
|
||||
TaskID string `json:"task_id"`
|
||||
SourceID string `json:"source_id" binding:"required"`
|
||||
TargetID string `json:"target_id"`
|
||||
}
|
||||
@@ -372,8 +373,11 @@ func (h *KnowledgeBaseHandler) CopyKnowledgeBase(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// Generate task ID
|
||||
taskID := uuid.New().String()
|
||||
// Generate task ID if not provided
|
||||
taskID := req.TaskID
|
||||
if taskID == "" {
|
||||
taskID = uuid.New().String()
|
||||
}
|
||||
|
||||
// Create KB clone payload
|
||||
payload := types.KBClonePayload{
|
||||
|
||||
Reference in New Issue
Block a user