generalize the generation of new collection name by dataset id (#2620)

This commit is contained in:
Bowen Liang
2024-02-29 12:47:10 +08:00
committed by GitHub
parent 0428f44113
commit 801d135390
5 changed files with 12 additions and 8 deletions

View File

@@ -116,6 +116,10 @@ class Dataset(db.Model):
}
return self.retrieval_model if self.retrieval_model else default_retrieval_model
@staticmethod
def gen_collection_name_by_id(dataset_id: str) -> str:
normalized_dataset_id = dataset_id.replace("-", "_")
return f'Vector_index_{normalized_dataset_id}_Node'
class DatasetProcessRule(db.Model):
__tablename__ = 'dataset_process_rules'