@siact/sime-x-vue 0.0.12 → 0.0.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.
@@ -774,7 +774,8 @@
774
774
  debug: { type: Boolean },
775
775
  chatbotUrl: {},
776
776
  appId: {},
777
- appToken: {}
777
+ appToken: {},
778
+ agentId: {}
778
779
  },
779
780
  setup(__props) {
780
781
  const props = __props;
@@ -785,6 +786,7 @@
785
786
  chatbotUrl: () => props.chatbotUrl,
786
787
  appId: () => props.appId,
787
788
  appToken: () => props.appToken,
789
+ agentId: () => props.agentId,
788
790
  stopBroadcast: () => stopBroadcastRef.value(),
789
791
  registerVoiceMethods: (methods) => {
790
792
  if (methods.stopBroadcast) stopBroadcastRef.value = methods.stopBroadcast;
@@ -1770,9 +1772,9 @@
1770
1772
  const commandDefinitions = buildCommandDefinitionMap(commands);
1771
1773
  conversationHistory.value.length > 0 ? [...conversationHistory.value] : void 0;
1772
1774
  try {
1773
- const response = await fetch(options.endpoint.value, {
1775
+ const response = await fetch(options.endpoint, {
1774
1776
  method: "POST",
1775
- headers: { "Content-Type": "application/json" },
1777
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${options.appToken || ""}` },
1776
1778
  body: JSON.stringify({
1777
1779
  input: content,
1778
1780
  projectId: options.projectId || "",
@@ -1949,9 +1951,9 @@
1949
1951
  xSize: {},
1950
1952
  xTheme: {},
1951
1953
  wakeWords: {},
1954
+ wakeResponses: {},
1952
1955
  modelPath: {},
1953
1956
  projectId: {},
1954
- invokeUrl: {},
1955
1957
  voiceConfig: {},
1956
1958
  bubbleSize: {},
1957
1959
  bubbleDismissDelay: {}
@@ -1963,10 +1965,7 @@
1963
1965
  if (props.voiceConfig) return props.voiceConfig;
1964
1966
  return null;
1965
1967
  };
1966
- const endpoint = vue.computed(() => {
1967
- return props.invokeUrl || "http://localhost:3001/agent/zyy55sw40nrl801056m0o/stream-invoke";
1968
- });
1969
- const wakeResponses = ["在呢"];
1968
+ const wakeResponses = vue.computed(() => props.wakeResponses || ["在呢"]);
1970
1969
  const tts = useTTS(getVoiceConfig);
1971
1970
  const bubbleBridge = {
1972
1971
  open: () => {
@@ -1976,8 +1975,10 @@
1976
1975
  scrollToBottom: () => {
1977
1976
  }
1978
1977
  };
1978
+ const endpoint = `/sime/proxy/agent/${aiChatbotX.agentId()}/stream-invoke`;
1979
1979
  const agent = useAgentInvoke({
1980
1980
  endpoint,
1981
+ appToken: aiChatbotX.appToken(),
1981
1982
  projectId: props.projectId,
1982
1983
  aiChatbotX,
1983
1984
  tts: {
@@ -2016,7 +2017,7 @@
2016
2017
  onWake: () => {
2017
2018
  interruptCurrentResponse();
2018
2019
  tts.warmUpAudio();
2019
- const text = wakeResponses[Math.floor(Math.random() * wakeResponses.length)];
2020
+ const text = wakeResponses.value[Math.floor(Math.random() * wakeResponses.value.length)];
2020
2021
  tts.speak(text);
2021
2022
  },
2022
2023
  onTranscriptionDone: (text) => {
@@ -2122,7 +2123,7 @@
2122
2123
  vue.unref(transcriptionText) || vue.unref(isInvoking) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11, vue.toDisplayString(vue.unref(isInvoking) ? "正在思考中..." : vue.unref(transcriptionText)), 1)) : vue.createCommentVNode("", true),
2123
2124
  vue.createElementVNode("div", _hoisted_12, [
2124
2125
  vue.createElementVNode("img", {
2125
- src: __props.xLogo ? __props.xLogo : "/sime.png",
2126
+ src: __props.xLogo ? __props.xLogo : "/x.png",
2126
2127
  alt: "voice assistant",
2127
2128
  style: vue.normalizeStyle({
2128
2129
  width: `${__props.xSize?.width || 88}px`
@@ -2169,7 +2170,7 @@
2169
2170
  }
2170
2171
  });
2171
2172
 
2172
- const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fda883a9"]]);
2173
+ const voiceAssistant = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a88f03ab"]]);
2173
2174
 
2174
2175
  var clientCommandKey = /* @__PURE__ */ ((clientCommandKey2) => {
2175
2176
  clientCommandKey2["SET_THEME"] = "SiMeAgent_setTheme";