fix: stream have not return usage.

This commit is contained in:
2026-05-02 21:39:44 +08:00
parent ae5d70b951
commit 5e68e50aa1
+3
View File
@@ -452,6 +452,9 @@ func (tc *TrainingController) streamAIAnalysis(c *gin.Context, prompt string,
TopP: 0.6, TopP: 0.6,
MaxTokens: 4000, MaxTokens: 4000,
Stream: true, Stream: true,
StreamOptions: &openai.StreamOptions{
IncludeUsage: true,
},
}, },
) )
if err != nil { if err != nil {