Commit 62bfb152 by Calcium-Ion Committed by GitHub

Merge pull request #1252 from feitianbubu/pr/fix-playgroud-user-setting

fix: playground write user context to check acceptUnsetRatio
parents 0b245ff4 d93204e8
......@@ -66,5 +66,14 @@ func Playground(c *gin.Context) {
}
middleware.SetupContextForSelectedChannel(c, channel, playgroundRequest.Model)
c.Set(constant.ContextKeyRequestStartTime, time.Now())
// Write user context to ensure acceptUnsetRatio is available
userId := c.GetInt("id")
userCache, err := model.GetUserCache(userId)
if err != nil {
openaiErr = service.OpenAIErrorWrapperLocal(err, "get_user_cache_failed", http.StatusInternalServerError)
return
}
userCache.WriteContext(c)
Relay(c)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment