@ray-js/t-agent-plugin-aistream 0.2.0-beta-12 → 0.2.0-beta-13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,7 +34,8 @@ export class AIStreamConnection {
34
34
  _defineProperty(this, "promise", null);
35
35
  _defineProperty(this, "observer", null);
36
36
  _defineProperty(this, "onStateChanged", entry => {
37
- if (entry.type === 'connectionState' && entry.body.connectionId === this.connectionId) {
37
+ // 一个小程序只能启动一个 connection,所以这里不判断 id
38
+ if (entry.type === 'connectionState') {
38
39
  this.state = entry.body.connectState;
39
40
  this.activeSessions.forEach(session => {
40
41
  if (session.sessionId) {
@@ -288,7 +288,7 @@ export function withAIStream() {
288
288
  });
289
289
  const onError = async () => {
290
290
  end = true;
291
- if (userMsg.isShow) {
291
+ if (userMsg.isShow && userMsg.status !== ChatMessageStatus.FINISH) {
292
292
  await userMsg.remove();
293
293
  }
294
294
  audioEmitter.removeEventListener('error', onError);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent-plugin-aistream",
3
- "version": "0.2.0-beta-12",
3
+ "version": "0.2.0-beta-13",
4
4
  "author": "Tuya.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -35,5 +35,5 @@
35
35
  "devDependencies": {
36
36
  "@types/url-parse": "^1.4.11"
37
37
  },
38
- "gitHead": "a4e65a8f099f9ffa6e215ae005589c63f40587fe"
38
+ "gitHead": "ad4d4b4637a4a5396bcf5adf21adcbf215561436"
39
39
  }