feat(chat): 应用目录只配置成聚合应用
This commit is contained in:
1 parent
5bef77f86c
commit
dab04d4c3e
28 files changed
+797
-138
No files matched your search
@@ -11,7 +11,7 @@ from __future__ import annotations
|
||||
from datetime import datetime
|
||||
from typing import List, Optional
|
||||
|
||||
from sqlalchemy import DateTime, ForeignKey, Integer, JSON, String, Text
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Integer, JSON, String, Text, UniqueConstraint
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.models.base import Base, user_agent_permissions
|
||||
@@ -36,6 +36,7 @@ class Agent(Base):
|
||||
api_base_url: Mapped[Optional[str]] = mapped_column(String(255))
|
||||
extra_config: Mapped[Optional[dict]] = mapped_column(JSON)
|
||||
is_active: Mapped[bool] = mapped_column(default=True)
|
||||
is_aggregate: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)
|
||||
created_at: Mapped[datetime] = mapped_column(default=datetime.utcnow)
|
||||
|
||||
# Agent Registry 结构化列(迭代 1;详见 docs/platform/agent_application_management.md §3.1)
|
||||
@@ -90,6 +91,30 @@ class AgentGuide(Base):
|
||||
agent: Mapped[Optional['Agent']] = relationship('Agent', foreign_keys=[agent_id])
|
||||
|
||||
|
||||
class AgentDirectoryMember(Base):
|
||||
"""
|
||||
Directory-agent membership.
|
||||
|
||||
Purpose: lets an Agent act as a clickable directory entry while explicitly
|
||||
listing the child Agents whose knowledge should be included by the upstream
|
||||
aggregate Chatflow.
|
||||
"""
|
||||
|
||||
__tablename__ = 'agent_directory_members'
|
||||
__table_args__ = (
|
||||
UniqueConstraint('directory_agent_id', 'member_agent_id', name='uq_agent_directory_member_pair'),
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
directory_agent_id: Mapped[int] = mapped_column(ForeignKey('agents.id', ondelete='CASCADE'), index=True)
|
||||
member_agent_id: Mapped[int] = mapped_column(ForeignKey('agents.id', ondelete='CASCADE'), index=True)
|
||||
sort_order: Mapped[int] = mapped_column(Integer, default=0, nullable=False)
|
||||
created_at: Mapped[datetime] = mapped_column(default=datetime.utcnow)
|
||||
|
||||
directory_agent: Mapped[Optional['Agent']] = relationship('Agent', foreign_keys=[directory_agent_id])
|
||||
member_agent: Mapped[Optional['Agent']] = relationship('Agent', foreign_keys=[member_agent_id])
|
||||
|
||||
|
||||
class PermissionRequest(Base):
|
||||
"""
|
||||
权限申请表
|
||||
|
||||
Reference in new issue
Block a user