@zero-library/chat-agent 2.2.15 → 2.2.16
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 +6 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.esm.js +6 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -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;
|