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
@@ -34,8 +34,9 @@ func scopeCustomAgentsByModelID(db *gorm.DB, modelID string) *gorm.DB {
return db.Where(
"config->>'model_id' = ? OR config->>'rerank_model_id' = ? OR "+
"config->>'vlm_model_id' = ? OR config->>'asr_model_id' = ? OR "+
"config->>'query_understand_model_id' = ?",
modelID, modelID, modelID, modelID, modelID,
"config->>'query_understand_model_id' = ? OR "+
"config->'question_suggestions'->'follow_ups'->>'model_id' = ?",
modelID, modelID, modelID, modelID, modelID, modelID,
)
}
return db.Where(
@@ -43,7 +44,8 @@ func scopeCustomAgentsByModelID(db *gorm.DB, modelID string) *gorm.DB {
"json_extract(config, '$.rerank_model_id') = ? OR "+
"json_extract(config, '$.vlm_model_id') = ? OR "+
"json_extract(config, '$.asr_model_id') = ? OR "+
"json_extract(config, '$.query_understand_model_id') = ?",
modelID, modelID, modelID, modelID, modelID,
"json_extract(config, '$.query_understand_model_id') = ? OR "+
"json_extract(config, '$.question_suggestions.follow_ups.model_id') = ?",
modelID, modelID, modelID, modelID, modelID, modelID,
)
}