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
commit 801d135390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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'