Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
@@ -216,8 +216,12 @@ class WebSocketUtils {
|
|
216 |
case 'next':
|
217 |
const chatResponse = await this.handleChatResponse(parsedMessage);
|
218 |
if (chatResponse) {
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
221 |
break;
|
222 |
case 'complete':
|
223 |
isComplete = true;
|
|
|
216 |
case 'next':
|
217 |
const chatResponse = await this.handleChatResponse(parsedMessage);
|
218 |
if (chatResponse) {
|
219 |
+
responseContent = chatResponse;
|
220 |
+
// 获取到响应后立即关闭连接
|
221 |
+
isComplete = true;
|
222 |
+
ws.close();
|
223 |
+
resolve(responseContent);
|
224 |
+
}
|
225 |
break;
|
226 |
case 'complete':
|
227 |
isComplete = true;
|