Release/v0.2.2 (#260)
* [modify] migration script * [add] migration script * fix(web): change form message * fix(web): the memoryContent field is compatible with numbers and strings * feat(web): code node hidden * fix(model): 1. create a basic model to check if the name and provider are duplicated. 2. The result shows error models because the provider created API Keys for all matching models. --------- Co-authored-by: Mark <zhuwenhui5566@163.com> Co-authored-by: zhaoying <yzhao96@best-inc.com> Co-authored-by: yingzhao <zhaoyingyz@126.com> Co-authored-by: Timebomb2018 <18868801967@163.com>
This commit is contained in:
@@ -630,6 +630,13 @@ class ModelBaseRepository:
|
||||
db.add(model_base)
|
||||
return model_base
|
||||
|
||||
@staticmethod
|
||||
def get_by_name_and_provider(db: Session, name: str, provider: str) -> Optional['ModelBase']:
|
||||
return db.query(ModelBase).filter(
|
||||
ModelBase.name == name,
|
||||
ModelBase.provider == provider
|
||||
).first()
|
||||
|
||||
@staticmethod
|
||||
def update(db: Session, model_base_id: uuid.UUID, data: dict) -> Optional['ModelBase']:
|
||||
model_base = db.query(ModelBase).filter(ModelBase.id == model_base_id).first()
|
||||
|
||||
Reference in New Issue
Block a user