from pydantic import BaseModel, Field

class AgentCreate(BaseModel):
    """创建智能体身份。"""

    name: str
    description: str = ""
    language: str = "zh"
    model_name: str = ""

class AgentUpdate(BaseModel):
    """更新智能体身份字段（可空字段，仅提交需要变更的项）。"""

    name: str | None = None
    description: str | None = None
    language: str | None = None
    model_name: str | None = None
    use_fixed_soul: bool | None = None

class AgentInfo(BaseModel):
    """智能体身份记录（按用户隔离）。

    - ``deletable``：是否允许删除（默认智能体由服务端保护为不可删）。
    - ``use_fixed_soul``：该智能体是否**必须**使用服务端托管、最高优先级的
      ``fixed_soul`` 不可变段（否则忽略）。
    """

    id: str
    user_id: str
    port: str = "opc"
    name: str
    description: str = ""
    language: str = "zh"
    model_name: str = ""
    created_at: str = ""
    updated_at: str = ""
    deletable: bool = True
    use_fixed_soul: bool = False

