mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	fixed bug for QWen response blank quotes
This commit is contained in:
		@@ -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",
 | 
			
		||||
 
 | 
			
		||||
@@ -82,10 +82,11 @@ func (h *ChatHandler) sendQWenMessage(
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if strings.HasPrefix(line, "data:") {
 | 
			
		||||
				content = line[5:]
 | 
			
		||||
			if !strings.HasPrefix(line, "data:") {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			content = line[5:]
 | 
			
		||||
			var resp qWenResp
 | 
			
		||||
			if len(contents) == 0 { // 发送消息头
 | 
			
		||||
				if !outPutStart {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user