feat(agent): add question suggestions with after-answer follow-ups

Enable agents to configure starter prompts and async follow-up questions after completed answers, with durable caching, analytics events, and chat/embed UI integration.
This commit is contained in:
wizardchen
2026-07-14 11:06:13 +08:00
committed by lyingbug
parent a6c85dad28
commit 087fcc9fe7
50 changed files with 3781 additions and 179 deletions
+10
View File
@@ -93,6 +93,11 @@ func (h *CustomAgentHandler) CreateAgent(c *gin.Context) {
Avatar: req.Avatar,
Config: req.Config,
}
agent.EnsureDefaults()
if err := agent.Config.QuestionSuggestions.Validate(); err != nil {
c.Error(errors.NewBadRequestError(err.Error()))
return
}
logger.Infof(ctx, "Creating custom agent, name: %s, agent_mode: %s",
secutils.SanitizeForLog(req.Name), req.Config.AgentMode)
@@ -332,6 +337,11 @@ func (h *CustomAgentHandler) UpdateAgent(c *gin.Context) {
Avatar: req.Avatar,
Config: req.Config,
}
agent.EnsureDefaults()
if err := agent.Config.QuestionSuggestions.Validate(); err != nil {
c.Error(errors.NewBadRequestError(err.Error()))
return
}
logger.Infof(ctx, "Updating custom agent, ID: %s, name: %s",
secutils.SanitizeForLog(id), secutils.SanitizeForLog(req.Name))