feat(model and app statistic): 1. Optimize the model list; 2. Increase the model combination; 3. Add a model square; 4. Add application management statistics

This commit is contained in:
Timebomb2018
2026-01-28 11:04:46 +08:00
parent 2862db3534
commit e5e914903c
2 changed files with 6 additions and 2 deletions

View File

@@ -149,7 +149,7 @@ class ModelBase(Base):
description = Column(Text, comment="模型描述") description = Column(Text, comment="模型描述")
is_deprecated = Column(Boolean, default=False, nullable=False, comment="是否弃用") is_deprecated = Column(Boolean, default=False, nullable=False, comment="是否弃用")
is_official = Column(Boolean, default=True, comment="是否供应商官方模型(区分自定义)") is_official = Column(Boolean, default=True, comment="是否供应商官方模型(区分自定义)")
tags = Column(ARRAY(String), default=[], nullable=False, comment="模型标签(如['聊天', '创作']") tags = Column(ARRAY(String), default=list, nullable=False, comment="模型标签(如['聊天', '创作']")
add_count = Column(Integer, default=0, nullable=False, comment="模型被用户添加的次数") add_count = Column(Integer, default=0, nullable=False, comment="模型被用户添加的次数")
# 关联关系 # 关联关系

View File

@@ -4,6 +4,10 @@ import datetime
import uuid import uuid
from app.models.models_model import ModelProvider, ModelType from app.models.models_model import ModelProvider, ModelType
from app.core.logging_config import get_business_logger
schema_logger = get_business_logger()
@@ -164,7 +168,7 @@ class ModelApiKey(ModelApiKeyBase):
and getattr(mc, 'name', None) == self.model_name)) and getattr(mc, 'name', None) == self.model_name))
] ]
except Exception as e: except Exception as e:
print(f"提取 model_config_ids 失败:{e}") schema_logger.warning(f"提取 model_config_ids 失败:{e}")
self.model_config_ids = [] self.model_config_ids = []
model_config = ConfigDict( model_config = ConfigDict(