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