fixed bug for QWen response blank quotes

This commit is contained in:
RockYang
2024-04-19 10:55:29 +08:00
parent 0d5b4936bd
commit a38d547200
3 changed files with 12 additions and 6 deletions

View File

@@ -326,10 +326,12 @@ func (h *ChatHandler) sendMessage(ctx context.Context, session *types.ChatSessio
}
if session.Model.Platform == types.QWen {
req.Input = map[string]interface{}{"prompt": prompt}
if len(reqMgs) > 0 {
req.Input["messages"] = reqMgs
}
req.Input = make(map[string]interface{})
reqMgs = append(reqMgs, types.Message{
Role: "user",
Content: prompt,
})
req.Input["messages"] = reqMgs
} else {
req.Messages = append(reqMgs, map[string]interface{}{
"role": "user",