perf(workflow): optimize default values for LLM node configuration
This commit is contained in:
@@ -66,7 +66,7 @@ class LLMNodeConfig(BaseNodeConfig):
|
|||||||
)
|
)
|
||||||
|
|
||||||
memory: MemoryWindowSetting = Field(
|
memory: MemoryWindowSetting = Field(
|
||||||
...,
|
default_factory=MemoryWindowSetting,
|
||||||
description="对话上下文窗口"
|
description="对话上下文窗口"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -758,8 +758,7 @@ class AppService:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 构建查询条件
|
# 构建查询条件
|
||||||
filters = []
|
filters = [App.is_active == True]
|
||||||
filters.append(App.is_active == True)
|
|
||||||
if type:
|
if type:
|
||||||
filters.append(App.type == type)
|
filters.append(App.type == type)
|
||||||
if visibility:
|
if visibility:
|
||||||
@@ -948,8 +947,12 @@ class AppService:
|
|||||||
# 只读操作,允许访问共享应用
|
# 只读操作,允许访问共享应用
|
||||||
self._validate_app_accessible(app, workspace_id)
|
self._validate_app_accessible(app, workspace_id)
|
||||||
|
|
||||||
stmt = select(AgentConfig).where(AgentConfig.app_id == app_id, AgentConfig.is_active == True).order_by(
|
stmt = select(AgentConfig).where(
|
||||||
AgentConfig.updated_at.desc())
|
AgentConfig.app_id == app_id,
|
||||||
|
AgentConfig.is_active.is_(True)
|
||||||
|
).order_by(
|
||||||
|
AgentConfig.updated_at.desc()
|
||||||
|
)
|
||||||
config = self.db.scalars(stmt).first()
|
config = self.db.scalars(stmt).first()
|
||||||
|
|
||||||
if config:
|
if config:
|
||||||
@@ -1265,7 +1268,7 @@ class AppService:
|
|||||||
raise BusinessException("应用缺少有效配置,无法发布", BizCode.CONFIG_MISSING)
|
raise BusinessException("应用缺少有效配置,无法发布", BizCode.CONFIG_MISSING)
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"id": workflow_cfg.id,
|
"id": str(workflow_cfg.id),
|
||||||
"nodes": workflow_cfg.nodes,
|
"nodes": workflow_cfg.nodes,
|
||||||
"edges": workflow_cfg.edges,
|
"edges": workflow_cfg.edges,
|
||||||
"variables": workflow_cfg.variables,
|
"variables": workflow_cfg.variables,
|
||||||
@@ -2063,8 +2066,12 @@ def publish(db: Session, *, app_id: uuid.UUID, publisher_id: uuid.UUID, workspac
|
|||||||
workspace_id=workspace_id, release_notes=release_notes)
|
workspace_id=workspace_id, release_notes=release_notes)
|
||||||
|
|
||||||
|
|
||||||
def get_current_release(db: Session, *, app_id: uuid.UUID, workspace_id: uuid.UUID | None = None) -> Optional[
|
def get_current_release(
|
||||||
AppRelease]:
|
db: Session,
|
||||||
|
*,
|
||||||
|
app_id: uuid.UUID,
|
||||||
|
workspace_id: uuid.UUID | None = None
|
||||||
|
) -> Optional[AppRelease]:
|
||||||
"""获取当前发布版本(向后兼容接口)"""
|
"""获取当前发布版本(向后兼容接口)"""
|
||||||
service = AppService(db)
|
service = AppService(db)
|
||||||
return service.get_current_release(app_id=app_id, workspace_id=workspace_id)
|
return service.get_current_release(app_id=app_id, workspace_id=workspace_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user