mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-11 13:59:04 +08:00
fix(model): make sure AppModelConfig.model_dict returns a dict. (#10972)
This commit is contained in:
parent
8a83edc1b5
commit
535c72cad7
@ -255,7 +255,7 @@ class AppModelConfig(db.Model):
|
||||
|
||||
@property
|
||||
def model_dict(self) -> dict:
|
||||
return json.loads(self.model) if self.model else None
|
||||
return json.loads(self.model) if self.model else {}
|
||||
|
||||
@property
|
||||
def suggested_questions_list(self) -> list:
|
||||
@ -600,8 +600,8 @@ class Conversation(db.Model):
|
||||
app_model_config = (
|
||||
db.session.query(AppModelConfig).filter(AppModelConfig.id == self.app_model_config_id).first()
|
||||
)
|
||||
|
||||
model_config = app_model_config.to_dict()
|
||||
if app_model_config:
|
||||
model_config = app_model_config.to_dict()
|
||||
|
||||
model_config["model_id"] = self.model_id
|
||||
model_config["provider"] = self.model_provider
|
||||
|
Loading…
x
Reference in New Issue
Block a user