@zero-library/chat-agent 2.2.15 → 2.2.17

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/index.cjs.js CHANGED
@@ -363,7 +363,7 @@ var createChatService = (request) => {
363
363
  };
364
364
  var createFileService = (request) => {
365
365
  const docQuery = (paramsStr) => {
366
- return request.get(`/uc/doc?${paramsStr}`);
366
+ return request.get(`/lolr/doc?${paramsStr}`);
367
367
  };
368
368
  const fileCreate = async (fileContent, fileName, targetFormat = "docx") => {
369
369
  const blob = await request.post(`/uc/doc/convert`, { fileContent, fileName, targetFormat }, { responseType: "blob" });
@@ -689,8 +689,13 @@ function createChatStore() {
689
689
  const setSpeakHuman = (speakHuman) => {
690
690
  conversation.messages[conversation.active.id].speakHuman = speakHuman;
691
691
  };
692
- const setReferences = (references) => {
692
+ const setReferences = async (references) => {
693
+ const canProceed = await config.hooks?.onBeforeSetReferences?.(references);
694
+ if (canProceed === false) {
695
+ throw new Error("\u64CD\u4F5C\u88AB\u963B\u6B62");
696
+ }
693
697
  conversation.messages[conversation.active.id].references = references;
698
+ config.hooks?.onAfterSetReferences?.(references);
694
699
  };
695
700
  const setContent = (content) => {
696
701
  conversation.messages[conversation.active.id].content = content;