fix(model): block deletion when model is referenced by KB or agent
Reject model delete with HTTP 400 when the current tenant still has knowledge bases or custom agents bound to the model ID.
This commit is contained in:
@@ -921,6 +921,9 @@ func (r *realKBRepo) CountByVectorStoreID(ctx context.Context, db *gorm.DB, tena
|
||||
Count(&count).Error
|
||||
return count, err
|
||||
}
|
||||
func (r *realKBRepo) CountByModelID(_ context.Context, _ uint64, _ string) (int64, error) {
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
// The remaining methods are not called by the tested code paths; declare them
|
||||
// so realKBRepo satisfies interfaces.KnowledgeBaseRepository.
|
||||
|
||||
Reference in New Issue
Block a user