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];