refactor: remove remark field from AIAgent and related components
This commit is contained in:
Vendored
-1
@@ -91,7 +91,6 @@ func buildSeedItems(aiConfigID int64, knowledgeIDs []int64, defaultTeamIDs strin
|
||||
KnowledgeIDs: utils.JoinInt64s(knowledgeIDs),
|
||||
SkillIDs: defaultSkillIDs,
|
||||
SortNo: 10,
|
||||
Remark: "Local testdata seed",
|
||||
AuditFields: models.AuditFields{
|
||||
CreatedAt: now,
|
||||
CreateUserID: 0,
|
||||
|
||||
@@ -94,7 +94,6 @@ const schema = z.object({
|
||||
.min(0, "回复超时秒数必须是大于等于 0 的整数"),
|
||||
handoffMode: z.string().trim().min(1, "请选择转人工模式"),
|
||||
fallbackMessage: z.string().trim(),
|
||||
remark: z.string().trim(),
|
||||
});
|
||||
|
||||
type EditForm = z.infer<typeof schema>;
|
||||
@@ -131,7 +130,6 @@ function buildForm(item: AIAgent | null): EditForm {
|
||||
replyTimeoutSeconds: 180,
|
||||
handoffMode: String(AIAgentHandoffMode.WaitPool),
|
||||
fallbackMessage: "",
|
||||
remark: "",
|
||||
};
|
||||
}
|
||||
return {
|
||||
@@ -144,7 +142,6 @@ function buildForm(item: AIAgent | null): EditForm {
|
||||
replyTimeoutSeconds: item.replyTimeoutSeconds ?? 180,
|
||||
handoffMode: String(item.handoffMode),
|
||||
fallbackMessage: item.fallbackMessage || "",
|
||||
remark: item.remark || "",
|
||||
};
|
||||
}
|
||||
|
||||
@@ -171,7 +168,6 @@ function buildPayload(
|
||||
skillIds,
|
||||
directTools,
|
||||
graphTools,
|
||||
remark: form.remark.trim(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -729,15 +725,6 @@ function EditDialogBody({
|
||||
<FieldError errors={[errors.description]} />
|
||||
</FieldContent>
|
||||
</Field>
|
||||
|
||||
<Field data-invalid={!!errors.remark}>
|
||||
<FieldLabel htmlFor="ai-agent-remark">内部备注</FieldLabel>
|
||||
<FieldContent>
|
||||
<Textarea id="ai-agent-remark" rows={3} {...register("remark")} />
|
||||
<FieldError errors={[errors.remark]} />
|
||||
</FieldContent>
|
||||
</Field>
|
||||
|
||||
<Field data-invalid={!!errors.welcomeMessage}>
|
||||
<FieldLabel htmlFor="ai-agent-welcome-message">欢迎语</FieldLabel>
|
||||
<FieldContent>
|
||||
|
||||
@@ -223,7 +223,6 @@ export type AIAgent = {
|
||||
}[]
|
||||
graphTools: string[]
|
||||
sortNo: number
|
||||
remark: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
createUserName: string
|
||||
@@ -252,7 +251,6 @@ export type CreateAIAgentPayload = {
|
||||
arguments?: Record<string, string>
|
||||
}[]
|
||||
graphTools: string[]
|
||||
remark: string
|
||||
}
|
||||
|
||||
export type UpdateAIAgentPayload = CreateAIAgentPayload & {
|
||||
|
||||
@@ -133,7 +133,6 @@ func buildAIAgentResponse(item *models.AIAgent) response.AIAgentResponse {
|
||||
DirectTools: make([]response.AIAgentMCPToolResponse, 0),
|
||||
GraphTools: make([]string, 0),
|
||||
SortNo: item.SortNo,
|
||||
Remark: item.Remark,
|
||||
CreatedAt: item.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
UpdatedAt: item.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||||
CreateUserName: item.CreateUserName,
|
||||
|
||||
@@ -515,7 +515,6 @@ type AIAgent struct {
|
||||
AllowedMCPTools string `gorm:"type:text"` // AllowedMCPTools 为允许 direct tool 路由的 MCP 工具白名单配置JSON。
|
||||
AllowedGraphTools string `gorm:"type:text"` // AllowedGraphTools 为允许 Graph Tool 的白名单配置JSON。
|
||||
SortNo int `gorm:"type:int;not null;default:0;index"` // SortNo 为后台展示排序号。
|
||||
Remark string `gorm:"type:text"` // Remark 为备注。
|
||||
AuditFields
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ type CreateAIAgentRequest struct {
|
||||
SkillIDs []int64 `json:"skillIds"`
|
||||
DirectTools []AIAgentMCPToolRequest `json:"directTools"`
|
||||
GraphTools []string `json:"graphTools"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type UpdateAIAgentRequest struct {
|
||||
|
||||
@@ -91,7 +91,6 @@ type AIAgentResponse struct {
|
||||
DirectTools []AIAgentMCPToolResponse `json:"directTools"`
|
||||
GraphTools []string `json:"graphTools"`
|
||||
SortNo int `json:"sortNo"`
|
||||
Remark string `json:"remark"`
|
||||
CreatedAt string `json:"createdAt"`
|
||||
UpdatedAt string `json:"updatedAt"`
|
||||
CreateUserName string `json:"createUserName"`
|
||||
|
||||
@@ -106,7 +106,6 @@ func (s *aIAgentService) UpdateAIAgent(req request.UpdateAIAgentRequest, operato
|
||||
"skill_ids": item.SkillIDs,
|
||||
"allowed_mcp_tools": item.AllowedMCPTools,
|
||||
"allowed_graph_tools": item.AllowedGraphTools,
|
||||
"remark": item.Remark,
|
||||
"update_user_id": operator.UserID,
|
||||
"update_user_name": operator.Username,
|
||||
"updated_at": time.Now(),
|
||||
@@ -215,7 +214,6 @@ func (s *aIAgentService) buildAIAgentModel(id int64, req request.CreateAIAgentRe
|
||||
SkillIDs: utils.JoinInt64s(skillIDs),
|
||||
AllowedMCPTools: directToolsJSON,
|
||||
AllowedGraphTools: graphToolsJSON,
|
||||
Remark: strings.TrimSpace(req.Remark),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user