@siact/sime-x-vue 0.0.19 → 0.0.20

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.
@@ -1512,7 +1512,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1512
1512
  }
1513
1513
  };
1514
1514
  const test = () => {
1515
- aiChatbotX.invokeText("你好");
1515
+ aiChatbotX.speakText("你好,世界,今天是想起五天气横扫的缺点");
1516
1516
  };
1517
1517
  const test1 = () => {
1518
1518
  aiChatbotX.abortInvoke();
@@ -1678,7 +1678,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1678
1678
  }
1679
1679
  });
1680
1680
 
1681
- const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-93ed98f5"]]);
1681
+ const commandTest = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2d2cea1f"]]);
1682
1682
 
1683
1683
  class CommandManager {
1684
1684
  commands = /* @__PURE__ */ new Map();
@@ -1751,9 +1751,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1751
1751
  });
1752
1752
  const stopBroadcastRef = shallowRef(async () => {
1753
1753
  });
1754
- const voiceAssistantRef = shallowRef(
1755
- null
1756
- );
1754
+ const voiceAssistantRef = shallowRef(null);
1757
1755
  provide(AiChatbotXKey, {
1758
1756
  appToken: () => props.appToken,
1759
1757
  organizationId: () => props.organizationId,
@@ -1778,9 +1776,15 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1778
1776
  async executeCommand(commandName, args = []) {
1779
1777
  return await commandManager.value.executeCommand(commandName, args);
1780
1778
  },
1781
- invokeText: async (text) => {
1779
+ sendMessage: async (text) => {
1782
1780
  voiceAssistantRef.value?.agentInvoke(text);
1783
1781
  },
1782
+ speakText: (text) => {
1783
+ voiceAssistantRef.value?.speakText(text);
1784
+ },
1785
+ stopSpeak: () => {
1786
+ voiceAssistantRef.value?.stopSpeak();
1787
+ },
1784
1788
  abortInvoke: () => {
1785
1789
  voiceAssistantRef.value?.agentAbort();
1786
1790
  }
@@ -2322,6 +2326,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2322
2326
  tts.stop();
2323
2327
  bubble.hide();
2324
2328
  };
2329
+ const speakTextWithBubble = (text) => {
2330
+ bubble.open();
2331
+ agent.currentTextContent.value = text;
2332
+ tts.speak(text);
2333
+ };
2325
2334
  const voice = useVoiceRecognition({
2326
2335
  modelPath: props.modelPath,
2327
2336
  wakeWords: props.wakeWords,
@@ -2349,7 +2358,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2349
2358
  });
2350
2359
  aiChatbotX?.registerVoiceAssistant({
2351
2360
  agentInvoke: agent.invoke,
2352
- agentAbort: agent.abort
2361
+ agentAbort: agent.abort,
2362
+ speakText: speakTextWithBubble,
2363
+ stopSpeak: tts.stop
2353
2364
  });
2354
2365
  onBeforeUnmount(async () => {
2355
2366
  bubble.destroy();
@@ -2487,7 +2498,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
2487
2498
  }
2488
2499
  });
2489
2500
 
2490
- const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d1d9b351"]]);
2501
+ const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5f5506a2"]]);
2491
2502
 
2492
2503
  var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
2493
2504
  clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";