diff --git a/api/app/services/app_service.py b/api/app/services/app_service.py index 38eb5f4c..4583fadb 100644 --- a/api/app/services/app_service.py +++ b/api/app/services/app_service.py @@ -957,11 +957,16 @@ class AppService: ) config = self.db.scalars(stmt).first() - config_memory=config.memory - if 'memory_content' in config_memory: - config.memory['memory_config_id'] = config.memory.pop('memory_content') + + try: + config_memory=config.memory + if 'memory_content' in config_memory: + config.memory['memory_config_id'] = config.memory.pop('memory_content') + except: + logger.debug("记忆配置不存在") if config: return config + # 返回默认配置模板(不保存到数据库) logger.debug("配置不存在,返回默认模板", extra={"app_id": str(app_id)}) return self._create_default_agent_config(app_id)