mirror of
				https://github.com/songquanpeng/one-api.git
				synced 2025-11-04 15:53:42 +08:00 
			
		
		
		
	chore: use StringContent() to convert response to text
This commit is contained in:
		@@ -274,7 +274,7 @@ func StreamHandler(c *gin.Context, resp *http.Response) (*model.ErrorWithStatusC
 | 
				
			|||||||
			if response == nil {
 | 
								if response == nil {
 | 
				
			||||||
				return true
 | 
									return true
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			responseText += fmt.Sprintf("%v", response.Choices[0].Delta.Content)
 | 
								responseText += response.Choices[0].Delta.StringContent()
 | 
				
			||||||
			jsonResponse, err := json.Marshal(response)
 | 
								jsonResponse, err := json.Marshal(response)
 | 
				
			||||||
			if err != nil {
 | 
								if err != nil {
 | 
				
			||||||
				logger.SysError("error marshalling stream response: " + err.Error())
 | 
									logger.SysError("error marshalling stream response: " + err.Error())
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user