@ray-js/t-agent 0.0.7-beta-1 → 0.0.8-beta-1

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.
@@ -1,5 +1,5 @@
1
1
  import { Hookable } from 'hookable';
2
- import { AbortSignalObject, AddHookCallback, ChatAgentHooks, ChatAgentHooksWithOrder, ChatAgentPlugin, ComposeHandler, InputBlock, ChatMessageObject, StreamResponseInstance } from './types';
2
+ import { AbortSignalObject, AddHookCallback, ChatAgentHooks, ChatAgentHooksWithOrder, ChatAgentPlugin, ChatMessageObject, ComposeHandler, InputBlock, StreamResponseInstance } from './types';
3
3
  import ChatSession from './ChatSession';
4
4
  import ChatMessage from './ChatMessage';
5
5
  type AddHook<T extends keyof ChatAgentHooks> = AddHookCallback<ChatAgentHooks, T>;
@@ -225,11 +225,10 @@ export default class ChatAgent {
225
225
  }
226
226
  }
227
227
  if (part.type === 'error') {
228
- if (part.level === 'error') {
229
- throw part.error;
230
- } else {
231
- await message.bubble.setStatus(BubbleTileStatus.WARNING).setText(part.error.message).update();
228
+ if (!message.bubble.text) {
229
+ message.bubble.setText(part.error.message);
232
230
  }
231
+ await message.bubble.setStatus(part.level === 'error' ? BubbleTileStatus.ERROR : BubbleTileStatus.WARNING).setInfo(part.error.message).update();
233
232
  }
234
233
  }
235
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/t-agent",
3
- "version": "0.0.7-beta-1",
3
+ "version": "0.0.8-beta-1",
4
4
  "author": "Tuya.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -26,5 +26,5 @@
26
26
  "build": "ray build --type=component --output dist",
27
27
  "clean": "rimraf ./dist"
28
28
  },
29
- "gitHead": "95aecc47d002cbf5e608c129478905c7fb458ea9"
29
+ "gitHead": "16c52814d110e10b2e108915675d90e2b023df5e"
30
30
  }