@copilotkit/react-ui 1.6.0-next.8 → 1.6.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 +41 -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
|
@@ -2,18 +2,18 @@ import "../chunk-MMVDU6DF.mjs";
|
|
|
2
2
|
import "../chunk-SQMEPWVT.mjs";
|
|
3
3
|
import {
|
|
4
4
|
CopilotSidebar
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-3PJA5MFR.mjs";
|
|
6
6
|
import "../chunk-WB3YULQ4.mjs";
|
|
7
7
|
import {
|
|
8
8
|
CopilotPopup
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ADTTDBLB.mjs";
|
|
10
|
+
import "../chunk-AZU4QOV5.mjs";
|
|
11
11
|
import "../chunk-YAGE7RCE.mjs";
|
|
12
12
|
import "../chunk-VEC45H6Q.mjs";
|
|
13
13
|
import "../chunk-RQNJNK2W.mjs";
|
|
14
14
|
import {
|
|
15
15
|
CopilotChat
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-2C3ANQCY.mjs";
|
|
17
17
|
import "../chunk-UWWMAJ7R.mjs";
|
|
18
18
|
import "../chunk-WEYDZBT7.mjs";
|
|
19
19
|
import "../chunk-OFYI4UU4.mjs";
|
package/dist/index.js
CHANGED
|
@@ -2458,10 +2458,20 @@ function CopilotChat({
|
|
|
2458
2458
|
AssistantMessage: AssistantMessage2 = AssistantMessage,
|
|
2459
2459
|
UserMessage: UserMessage2 = UserMessage
|
|
2460
2460
|
}) {
|
|
2461
|
-
const
|
|
2461
|
+
const { additionalInstructions, setChatInstructions } = (0, import_react_core9.useCopilotContext)();
|
|
2462
2462
|
(0, import_react12.useEffect)(() => {
|
|
2463
|
-
|
|
2464
|
-
|
|
2463
|
+
if (!(additionalInstructions == null ? void 0 : additionalInstructions.length)) {
|
|
2464
|
+
setChatInstructions(instructions || "");
|
|
2465
|
+
return;
|
|
2466
|
+
}
|
|
2467
|
+
const combinedAdditionalInstructions = [
|
|
2468
|
+
instructions,
|
|
2469
|
+
"Additionally, follow these instructions:",
|
|
2470
|
+
...additionalInstructions.map((instruction) => `- ${instruction}`)
|
|
2471
|
+
];
|
|
2472
|
+
console.log("combinedAdditionalInstructions", combinedAdditionalInstructions);
|
|
2473
|
+
setChatInstructions(combinedAdditionalInstructions.join("\n") || "");
|
|
2474
|
+
}, [instructions, additionalInstructions]);
|
|
2465
2475
|
const {
|
|
2466
2476
|
visibleMessages,
|
|
2467
2477
|
isLoading,
|