@copilotkit/react-ui 1.6.0-next.9 → 1.7.0-next.0
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/CHANGELOG.md +49 -0
- package/dist/{chunk-FUFTTTA3.mjs → chunk-2C3ANQCY.mjs} +14 -4
- package/dist/chunk-2C3ANQCY.mjs.map +1 -0
- package/dist/{chunk-CU525PBJ.mjs → chunk-3PJA5MFR.mjs} +2 -2
- package/dist/{chunk-UGTFROVP.mjs → chunk-ADTTDBLB.mjs} +2 -2
- package/dist/{chunk-UY34ERRQ.mjs → chunk-AZU4QOV5.mjs} +2 -2
- package/dist/components/chat/Chat.js +13 -3
- package/dist/components/chat/Chat.js.map +1 -1
- package/dist/components/chat/Chat.mjs +1 -1
- package/dist/components/chat/Modal.js +13 -3
- package/dist/components/chat/Modal.js.map +1 -1
- package/dist/components/chat/Modal.mjs +2 -2
- package/dist/components/chat/Popup.js +13 -3
- package/dist/components/chat/Popup.js.map +1 -1
- package/dist/components/chat/Popup.mjs +3 -3
- package/dist/components/chat/Sidebar.js +13 -3
- package/dist/components/chat/Sidebar.js.map +1 -1
- package/dist/components/chat/Sidebar.mjs +3 -3
- package/dist/components/chat/index.js +13 -3
- package/dist/components/chat/index.js.map +1 -1
- package/dist/components/chat/index.mjs +4 -4
- package/dist/components/index.js +13 -3
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -4
- package/package.json +4 -4
- package/src/components/chat/Chat.tsx +24 -4
- package/dist/chunk-FUFTTTA3.mjs.map +0 -1
- /package/dist/{chunk-CU525PBJ.mjs.map → chunk-3PJA5MFR.mjs.map} +0 -0
- /package/dist/{chunk-UGTFROVP.mjs.map → chunk-ADTTDBLB.mjs.map} +0 -0
- /package/dist/{chunk-UY34ERRQ.mjs.map → chunk-AZU4QOV5.mjs.map} +0 -0
|
@@ -2446,10 +2446,20 @@ function CopilotChat({
|
|
|
2446
2446
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2447
2447
|
UserMessage: UserMessage2 = UserMessage
|
|
2448
2448
|
}) {
|
|
2449
|
-
const
|
|
2449
|
+
const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
|
|
2450
2450
|
(0, import_react12.useEffect)(() => {
|
|
2451
|
-
|
|
2452
|
-
|
|
2451
|
+
if (!(additionalInstructions == null ? void 0 : additionalInstructions.length)) {
|
|
2452
|
+
setChatInstructions(instructions || "");
|
|
2453
|
+
return;
|
|
2454
|
+
}
|
|
2455
|
+
const combinedAdditionalInstructions = [
|
|
2456
|
+
instructions,
|
|
2457
|
+
"Additionally, follow these instructions:",
|
|
2458
|
+
...additionalInstructions.map((instruction) => `- ${instruction}`)
|
|
2459
|
+
];
|
|
2460
|
+
console.log("combinedAdditionalInstructions", combinedAdditionalInstructions);
|
|
2461
|
+
setChatInstructions(combinedAdditionalInstructions.join("\n") || "");
|
|
2462
|
+
}, [instructions, additionalInstructions]);
|
|
2453
2463
|
const {
|
|
2454
2464
|
visibleMessages,
|
|
2455
2465
|
isLoading,
|