chore: replace all cn comments to en version by volc api (#313)

This commit is contained in:
tecvan
2025-07-31 15:18:11 +08:00
committed by GitHub
parent 91d6cdb430
commit 5abc63fba6
254 changed files with 5899 additions and 5844 deletions

View File

@@ -132,12 +132,12 @@ func (dao *KnowledgeDocumentDAO) DeleteDocuments(ctx context.Context, ids []int6
tx.Commit()
}
}()
// 删除document
// Delete document
err = tx.WithContext(ctx).Model(&model.KnowledgeDocument{}).Where("id in ?", ids).Delete(&model.KnowledgeDocument{}).Error
if err != nil {
return err
}
// 删除document_slice
// Delete document_slice
err = tx.WithContext(ctx).Model(&model.KnowledgeDocumentSlice{}).Where("document_id in?", ids).Delete(&model.KnowledgeDocumentSlice{}).Error
if err != nil {
return err

View File

@@ -120,7 +120,7 @@ func (dao *KnowledgeDocumentSliceDAO) listBatch(ctx context.Context, knowledgeID
pos []*model.KnowledgeDocumentSlice, hasMore bool, err error) {
if batchSize <= 0 {
batchSize = 100 // 默认批量大小
batchSize = 100 // Default batch size
}
do, err := dao.listDo(ctx, knowledgeID, documentID)
@@ -161,7 +161,7 @@ func (dao *KnowledgeDocumentSliceDAO) GetDocumentSliceIDs(ctx context.Context, d
if len(docIDs) == 0 {
return nil, errors.New("empty document ids")
}
// doc可能会有很多slice所以批量处理
// Doc may have many slices, so batch processing
sliceIDs = make([]int64, 0)
var mu sync.Mutex
errGroup, ctx := errgroup.WithContext(ctx)