From 5429cf6ca991e283fb23de2a6fb0a49378346732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B4=94=E5=BA=86=E6=89=8D=E4=B8=A8=E9=9D=99=E8=A7=85?= Date: Tue, 2 Jan 2024 02:10:55 +0800 Subject: [PATCH] Fix stream issue and netlify config (#13) --- ...zhishuyun-hub-f6e13cb0-5e45-443f-aea4-394d6cdcd1a6.json | 7 +++++++ netlify.toml | 2 +- src/operators/chat/operator.ts | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 change/@zhishuyun-hub-f6e13cb0-5e45-443f-aea4-394d6cdcd1a6.json diff --git a/change/@zhishuyun-hub-f6e13cb0-5e45-443f-aea4-394d6cdcd1a6.json b/change/@zhishuyun-hub-f6e13cb0-5e45-443f-aea4-394d6cdcd1a6.json new file mode 100644 index 0000000..a973551 --- /dev/null +++ b/change/@zhishuyun-hub-f6e13cb0-5e45-443f-aea4-394d6cdcd1a6.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "fix stream event and netlify build", + "packageName": "@zhishuyun/hub", + "email": "cqc@cuiqingcai.com", + "dependentChangeType": "patch" +} diff --git a/netlify.toml b/netlify.toml index b505b3e..7be1bf7 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ [build] - command = "vite build" + command = "vite build --mode=development" functions = "netlify/functions" publish = "dist" diff --git a/src/operators/chat/operator.ts b/src/operators/chat/operator.ts index 8e0658d..b6d5012 100644 --- a/src/operators/chat/operator.ts +++ b/src/operators/chat/operator.ts @@ -18,7 +18,7 @@ class ChatOperator { }, baseURL: options.endpoint, responseType: 'stream', - onDownloadProgress: (event: AxiosProgressEvent) => { + onDownloadProgress: ({ event }: AxiosProgressEvent) => { const response = event.target.response; const lines = response.split('\r\n').filter((line: string) => !!line); const lastLine = lines[lines.length - 1];