feat(app):

1. Add new functional features to the agent;
2. Enhance the voice output;
3. Modify the end_user binding;
4. Delete and modify the tools.
This commit is contained in:
Timebomb2018
2026-03-16 18:00:09 +08:00
parent b62c40dba3
commit ea391dc44e
22 changed files with 832 additions and 184 deletions

View File

@@ -31,6 +31,7 @@ class AgentConfig(Base):
variables = Column(JSON, default=list, nullable=True, comment="变量配置")
tools = Column(JSON, default=list, nullable=True, comment="工具配置")
skills = Column(JSON, default=dict, nullable=True, comment="技能配置")
features = Column(JSON, default=dict, nullable=True, comment="功能特性配置")
# 多 Agent 相关字段
agent_role = Column(String(20), comment="Agent 角色: master|sub|standalone")

View File

@@ -12,7 +12,8 @@ class EndUser(Base):
__tablename__ = "end_users"
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, nullable=False, index=True)
app_id = Column(UUID(as_uuid=True), ForeignKey("apps.id"), nullable=False)
app_id = Column(UUID(as_uuid=True), ForeignKey("apps.id"), nullable=True)
workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), nullable=False)
# end_user_id = Column(String, nullable=False, index=True)
other_id = Column(String, nullable=True) # Store original user_id
other_name = Column(String, default="", nullable=False)
@@ -61,4 +62,7 @@ class EndUser(Base):
app = relationship(
"App",
back_populates="end_users"
)
)
# 与 WorkSpace 的反向关系
workspace = relationship("Workspace", back_populates="end_users")

View File

@@ -110,7 +110,10 @@ class ToolConfig(Base):
# 元数据
version = Column(String(50), default="1.0.0")
tags = Column(JSON, default=list) # 标签列表
# 逻辑删除标志
is_active = Column(Boolean, default=True, server_default='true', nullable=False, index=True, comment="是否可用False表示已删除")
# 时间戳
created_at = Column(DateTime, default=datetime.now, nullable=False)
updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now, nullable=False)

View File

@@ -38,6 +38,7 @@ class Workspace(Base):
members = relationship("WorkspaceMember", back_populates="workspace") # users collaborate through membership
api_keys = relationship("ApiKey", back_populates="workspace", cascade="all, delete-orphan") # API Keys
memory_increments = relationship("MemoryIncrement", back_populates="workspace")
end_users = relationship("EndUser", back_populates="workspace", cascade="all, delete-orphan")
class WorkspaceMember(Base):
__tablename__ = "workspace_members"