Files
aiagent/backend/app/models/orchestration_template.py
renjianbo beff3fac8d fix: delete agent 500 error + dynamic personality + deployment guide
- Fix delete agent 500: clean up FK records (agent_llm_logs, permissions,
  schedules, executions, team_members) and unbind goals/tasks before delete
- Remove hardcoded personality templates in Android, replace with dynamic
  system prompt generation from name + description
- Set promptSectionsEnabled=false to bypass PromptComposer for personality
- Add Tencent Cloud Linux deployment guide (Docker Compose)
- Accumulated backend service updates, frontend UI fixes, Android app changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-29 01:17:21 +08:00

33 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
编排模板模型 — 保存可视化 Agent 编排画布配置
"""
from sqlalchemy import Column, String, Text, JSON, DateTime, ForeignKey, Index, func
from sqlalchemy.dialects.mysql import CHAR
from sqlalchemy.orm import relationship
from app.core.database import Base
import uuid
class OrchestrationTemplate(Base):
"""Agent 编排模板表"""
__tablename__ = "orchestration_templates"
id = Column(CHAR(36), primary_key=True, default=lambda: str(uuid.uuid4()), comment="模板ID")
name = Column(String(100), nullable=False, comment="模板名称")
description = Column(Text, comment="模板描述")
nodes = Column(JSON, nullable=False, comment="编排节点含Agent配置")
edges = Column(JSON, nullable=False, comment="编排连线")
user_id = Column(CHAR(36), ForeignKey("users.id"), comment="创建者ID")
workspace_id = Column(CHAR(36), ForeignKey("workspaces.id"), nullable=True, comment="所属工作区ID")
created_at = Column(DateTime, default=func.now(), comment="创建时间")
updated_at = Column(DateTime, default=func.now(), onupdate=func.now(), comment="更新时间")
user = relationship("User", backref="orchestration_templates")
__table_args__ = (
Index("ix_orchestration_templates_workspace", "workspace_id"),
)
def __repr__(self):
return f"<OrchestrationTemplate(id={self.id}, name={self.name})>"