修复AI分析SSE流断开:中间件透传Flusher、DB Key生效、错误提示不覆盖

This commit is contained in:
fish
2026-05-10 17:11:51 +08:00
parent 1094e82e88
commit 4cdc542291
4 changed files with 35 additions and 6 deletions

View File

@@ -88,7 +88,7 @@ func (d *Deps) Analyze(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Connection", "keep-alive")
if err := streamLLM(d.AIConfig, prompt, w, flusher); err != nil {
if err := streamLLM(llmCfg, prompt, w, flusher); err != nil {
log.Printf("[ai] stream error: %v", err)
sendSSE(w, flusher, "error", err.Error())
}