mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	fixup
This commit is contained in:
		@@ -103,11 +103,15 @@ export class ChatGPTApi implements LLMApi {
 | 
				
			|||||||
              return finish();
 | 
					              return finish();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            if (text.length === 0) continue;
 | 
					            if (text.length === 0) continue;
 | 
				
			||||||
            const json = JSON.parse(text);
 | 
					            try {
 | 
				
			||||||
            const delta = json.choices[0].delta.content;
 | 
					              const json = JSON.parse(text);
 | 
				
			||||||
            if (delta) {
 | 
					              const delta = json.choices[0].delta.content;
 | 
				
			||||||
              responseText += delta;
 | 
					              if (delta) {
 | 
				
			||||||
              options.onUpdate?.(responseText, delta);
 | 
					                responseText += delta;
 | 
				
			||||||
 | 
					                options.onUpdate?.(responseText, delta);
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            } catch (e) {
 | 
				
			||||||
 | 
					              console.error("[Request] parse error", text, chunk);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user