|
|
|
@ -137,6 +137,7 @@ class GptsApp(BaseModel): |
|
|
|
|
recommend_questions: Optional[List[RecommendQuestion]] = [] |
|
|
|
|
admins: List[str] = Field(default_factory=list) |
|
|
|
|
app_type: Optional[str] = None |
|
|
|
|
prologue: Optional[str] = None |
|
|
|
|
|
|
|
|
|
# By default, keep the last two rounds of conversation records as the context |
|
|
|
|
keep_start_rounds: int = 0 |
|
|
|
@ -179,6 +180,9 @@ class GptsApp(BaseModel): |
|
|
|
|
admins=d.get("admins", []), |
|
|
|
|
keep_start_rounds=d.get("keep_start_rounds", 0), |
|
|
|
|
keep_end_rounds=d.get("keep_end_rounds", 2), |
|
|
|
|
icon=d.get("icon", None), |
|
|
|
|
prologue=d.get("prologue", None), |
|
|
|
|
app_type=d.get("app_type", None) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
@model_validator(mode="before") |
|
|
|
@ -338,6 +342,8 @@ class GptsAppEntity(Model): |
|
|
|
|
|
|
|
|
|
app_type = Column(String(10), nullable=True, comment="分类") |
|
|
|
|
|
|
|
|
|
prologue = Column(String(1024), nullable=True, comment="开场白") |
|
|
|
|
|
|
|
|
|
__table_args__ = (UniqueConstraint("app_name", name="uk_gpts_app"),) |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -739,6 +745,7 @@ class GptsAppDao(BaseDao): |
|
|
|
|
"admins": [], |
|
|
|
|
"app_type": app_info.app_type, |
|
|
|
|
"type_label": type_label, #用于前端显示,type对应的汉字标签 |
|
|
|
|
"prologue": app_info.prologue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
def _group_app_details(self, app_codes, session): |
|
|
|
|