feat: add Skill model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
22
backend/app/models/skill.py
Normal file
22
backend/app/models/skill.py
Normal file
@@ -0,0 +1,22 @@
|
||||
from sqlalchemy import Column, String, Text, Boolean, JSON, ForeignKey
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.models.base import BaseModel
|
||||
|
||||
|
||||
class Skill(BaseModel):
|
||||
__tablename__ = "skills"
|
||||
|
||||
name = Column(String(100), nullable=False, unique=True, index=True)
|
||||
description = Column(Text, nullable=True) # 供 LLM 理解用途
|
||||
instructions = Column(Text, nullable=False) # Agent 执行时的指令模板
|
||||
agent_type = Column(String(50), nullable=False, index=True) # master/planner/executor/librarian/analyst
|
||||
tools = Column(JSON, default=list) # 引用的工具名称列表
|
||||
required_context = Column(JSON, default=list) # 需要的前置数据
|
||||
output_format = Column(Text, nullable=True) # 输出格式要求
|
||||
visibility = Column(String(20), default="private") # private/team/market
|
||||
team_id = Column(String(36), ForeignKey("users.id"), nullable=True)
|
||||
is_active = Column(Boolean, default=True)
|
||||
owner_id = Column(String(36), ForeignKey("users.id"), nullable=False)
|
||||
|
||||
owner = relationship("User", foreign_keys=[owner_id])
|
||||
team = relationship("User", foreign_keys=[team_id])
|
||||
Reference in New Issue
Block a user