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