@copilotkit/react-core 0.20.0-demofixes.2 → 0.20.0-tools.1
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/.turbo/turbo-build.log +143 -147
- package/CHANGELOG.md +3 -14
- package/dist/{chunk-KZNQLITJ.mjs → chunk-AVLJ3AWG.mjs} +2 -2
- package/dist/{chunk-ABXVFQLN.mjs → chunk-NW27C3BV.mjs} +39 -7
- package/dist/chunk-NW27C3BV.mjs.map +1 -0
- package/dist/components/copilot-provider/copilotkit.mjs +8 -439
- package/dist/components/copilot-provider/copilotkit.mjs.map +1 -1
- package/dist/components/copilot-provider/index.mjs +9 -439
- package/dist/components/copilot-provider/index.mjs.map +1 -1
- package/dist/components/copilot-provider/standard-copilot-api-config.mjs +4 -9
- package/dist/components/copilot-provider/standard-copilot-api-config.mjs.map +1 -1
- package/dist/components/index.mjs +10 -439
- package/dist/components/index.mjs.map +1 -1
- package/dist/context/copilot-context.mjs +5 -63
- package/dist/context/copilot-context.mjs.map +1 -1
- package/dist/context/index.mjs +6 -63
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/index.js +39 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +21 -392
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/use-chat.js +38 -6
- package/dist/hooks/use-chat.js.map +1 -1
- package/dist/hooks/use-chat.mjs +4 -204
- package/dist/hooks/use-chat.mjs.map +1 -1
- package/dist/hooks/use-copilot-chat.js +39 -7
- package/dist/hooks/use-copilot-chat.js.map +1 -1
- package/dist/hooks/use-copilot-chat.mjs +13 -340
- package/dist/hooks/use-copilot-chat.mjs.map +1 -1
- package/dist/hooks/use-flat-category-store.mjs +4 -65
- package/dist/hooks/use-flat-category-store.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-actionable.mjs +5 -85
- package/dist/hooks/use-make-copilot-actionable.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-document-readable.mjs +5 -77
- package/dist/hooks/use-make-copilot-document-readable.mjs.map +1 -1
- package/dist/hooks/use-make-copilot-readable.mjs +5 -77
- package/dist/hooks/use-make-copilot-readable.mjs.map +1 -1
- package/dist/hooks/use-tree.mjs +4 -150
- package/dist/hooks/use-tree.mjs.map +1 -1
- package/dist/index.js +40 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +46 -979
- package/dist/index.mjs.map +1 -1
- package/dist/lib/copilot-task.mjs +11 -183
- package/dist/lib/copilot-task.mjs.map +1 -1
- package/dist/lib/index.mjs +12 -183
- package/dist/lib/index.mjs.map +1 -1
- package/dist/openai-assistants/hooks/index.mjs +14 -228
- package/dist/openai-assistants/hooks/index.mjs.map +1 -1
- package/dist/openai-assistants/hooks/use-assistants.mjs +7 -45
- package/dist/openai-assistants/hooks/use-assistants.mjs.map +1 -1
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs +14 -228
- package/dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map +1 -1
- package/dist/openai-assistants/index.mjs +17 -228
- package/dist/openai-assistants/index.mjs.map +1 -1
- package/dist/openai-assistants/utils/index.mjs +5 -43
- package/dist/openai-assistants/utils/index.mjs.map +1 -1
- package/dist/openai-assistants/utils/process-message-stream.mjs +4 -43
- package/dist/openai-assistants/utils/process-message-stream.mjs.map +1 -1
- package/dist/types/index.mjs +1 -0
- package/dist/utils/fetch-chat-completion.mjs +5 -99
- package/dist/utils/fetch-chat-completion.mjs.map +1 -1
- package/package.json +4 -4
- package/src/hooks/use-chat.ts +57 -6
- package/dist/chunk-ABXVFQLN.mjs.map +0 -1
- /package/dist/{chunk-KZNQLITJ.mjs.map → chunk-AVLJ3AWG.mjs.map} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
Debugger attached.
|
|
2
1
|
|
|
3
|
-
> @copilotkit/react-core@0.20.0-
|
|
2
|
+
> @copilotkit/react-core@0.20.0-tools.0 build /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-core
|
|
4
3
|
> tsup --clean
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
CLI Building entry: src/index.tsx, src/components/index.ts, src/context/copilot-context.tsx, src/context/index.ts, src/hooks/index.ts, src/hooks/use-chat.ts, src/hooks/use-copilot-chat.ts, src/hooks/use-flat-category-store.ts, src/hooks/use-make-copilot-actionable.ts, src/hooks/use-make-copilot-document-readable.ts, src/hooks/use-make-copilot-readable.ts, src/hooks/use-tree.ts, src/lib/copilot-task.ts, src/lib/index.ts, src/openai-assistants/index.ts, src/types/document-pointer.ts, src/types/index.ts, src/types/system-message.ts, src/utils/fetch-chat-completion.ts, src/utils/utils.test.ts, src/utils/utils.ts, src/components/copilot-provider/copilotkit-props.tsx, src/components/copilot-provider/copilotkit.tsx, src/components/copilot-provider/index.ts, src/components/copilot-provider/standard-copilot-api-config.tsx, src/openai-assistants/utils/index.ts, src/openai-assistants/utils/process-message-stream.ts, src/openai-assistants/hooks/index.ts, src/openai-assistants/hooks/use-assistants.ts, src/openai-assistants/hooks/use-copilot-chat-v2.ts
|
|
5
|
+
CLI Building entry: src/index.tsx, src/components/index.ts, src/context/copilot-context.tsx, src/context/index.ts, src/hooks/index.ts, src/hooks/use-chat.ts, src/hooks/use-copilot-chat.ts, src/hooks/use-flat-category-store.ts, src/hooks/use-make-copilot-actionable.ts, src/hooks/use-make-copilot-document-readable.ts, src/hooks/use-make-copilot-readable.ts, src/hooks/use-tree.ts, src/lib/copilot-task.ts, src/lib/index.ts, src/openai-assistants/index.ts, src/types/document-pointer.ts, src/types/index.ts, src/types/system-message.ts, src/utils/fetch-chat-completion.ts, src/utils/utils.test.ts, src/utils/utils.ts, src/components/copilot-provider/copilotkit-props.tsx, src/components/copilot-provider/copilotkit.tsx, src/components/copilot-provider/index.ts, src/components/copilot-provider/standard-copilot-api-config.tsx, src/openai-assistants/hooks/index.ts, src/openai-assistants/hooks/use-assistants.ts, src/openai-assistants/hooks/use-copilot-chat-v2.ts, src/openai-assistants/utils/index.ts, src/openai-assistants/utils/process-message-stream.ts
|
|
8
6
|
CLI Using tsconfig: tsconfig.json
|
|
9
7
|
CLI tsup v6.7.0
|
|
10
8
|
CLI Using tsup config: /Users/ataibarkai/LocalGit/Recursively.ai/CopilotKit/CopilotKit/packages/react-core/tsup.config.ts
|
|
@@ -12,178 +10,178 @@ CLI Target: es6
|
|
|
12
10
|
CLI Cleaning output folder
|
|
13
11
|
ESM Build start
|
|
14
12
|
CJS Build start
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
CJS dist/utils/fetch-chat-completion.js 4.78 KB
|
|
14
|
+
CJS dist/types/document-pointer.js 841.00 B
|
|
15
|
+
CJS dist/lib/copilot-task.js 7.17 KB
|
|
16
|
+
CJS dist/openai-assistants/index.js 9.31 KB
|
|
17
|
+
CJS dist/components/copilot-provider/copilotkit-props.js 878.00 B
|
|
18
|
+
CJS dist/openai-assistants/hooks/index.js 9.21 KB
|
|
19
|
+
CJS dist/openai-assistants/utils/index.js 2.30 KB
|
|
20
|
+
CJS dist/context/index.js 3.60 KB
|
|
21
|
+
CJS dist/index.js 35.75 KB
|
|
22
|
+
CJS dist/context/copilot-context.js 3.62 KB
|
|
23
|
+
CJS dist/components/index.js 15.12 KB
|
|
24
|
+
CJS dist/hooks/use-make-copilot-actionable.js 4.47 KB
|
|
25
|
+
CJS dist/hooks/use-copilot-chat.js 14.25 KB
|
|
26
|
+
CJS dist/hooks/use-chat.js 9.02 KB
|
|
27
|
+
CJS dist/hooks/index.js 16.42 KB
|
|
28
|
+
CJS dist/hooks/use-make-copilot-readable.js 4.10 KB
|
|
29
|
+
CJS dist/lib/index.js 7.13 KB
|
|
30
|
+
CJS dist/hooks/use-make-copilot-document-readable.js 4.22 KB
|
|
31
|
+
CJS dist/hooks/use-tree.js 5.53 KB
|
|
32
|
+
CJS dist/types/system-message.js 833.00 B
|
|
33
|
+
CJS dist/utils/utils.js 797.00 B
|
|
34
|
+
CJS dist/utils/utils.test.js 184.00 B
|
|
35
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js 1.48 KB
|
|
36
|
+
CJS dist/types/index.js 797.00 B
|
|
37
|
+
CJS dist/components/copilot-provider/index.js 15.16 KB
|
|
38
|
+
CJS dist/openai-assistants/hooks/use-assistants.js 4.82 KB
|
|
39
|
+
CJS dist/hooks/use-flat-category-store.js 2.87 KB
|
|
40
|
+
CJS dist/components/copilot-provider/copilotkit.js 15.11 KB
|
|
41
|
+
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
42
|
+
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js 9.30 KB
|
|
43
|
+
CJS dist/utils/fetch-chat-completion.js.map 4.03 KB
|
|
44
|
+
CJS dist/lib/copilot-task.js.map 16.40 KB
|
|
45
|
+
CJS dist/types/document-pointer.js.map 292.00 B
|
|
46
|
+
CJS dist/components/copilot-provider/copilotkit-props.js.map 894.00 B
|
|
47
|
+
CJS dist/openai-assistants/index.js.map 20.70 KB
|
|
48
|
+
CJS dist/openai-assistants/hooks/index.js.map 21.00 KB
|
|
49
|
+
CJS dist/openai-assistants/utils/index.js.map 1.44 KB
|
|
50
|
+
CJS dist/context/index.js.map 4.67 KB
|
|
51
|
+
CJS dist/context/copilot-context.js.map 4.44 KB
|
|
52
|
+
CJS dist/index.js.map 66.55 KB
|
|
53
|
+
CJS dist/hooks/use-make-copilot-actionable.js.map 5.98 KB
|
|
54
|
+
CJS dist/components/index.js.map 27.51 KB
|
|
55
|
+
CJS dist/hooks/index.js.map 35.91 KB
|
|
56
|
+
CJS dist/hooks/use-copilot-chat.js.map 31.00 KB
|
|
57
|
+
CJS dist/hooks/use-chat.js.map 15.00 KB
|
|
58
|
+
CJS dist/hooks/use-make-copilot-document-readable.js.map 5.75 KB
|
|
59
|
+
CJS dist/types/system-message.js.map 249.00 B
|
|
60
|
+
CJS dist/hooks/use-tree.js.map 8.32 KB
|
|
61
|
+
CJS dist/utils/utils.js.map 137.00 B
|
|
62
|
+
CJS dist/lib/index.js.map 16.46 KB
|
|
63
|
+
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
64
|
+
CJS dist/hooks/use-make-copilot-readable.js.map 5.79 KB
|
|
65
|
+
CJS dist/utils/utils.test.js.map 354.00 B
|
|
66
|
+
CJS dist/types/index.js.map 253.00 B
|
|
67
|
+
CJS dist/openai-assistants/hooks/use-assistants.js.map 5.92 KB
|
|
68
|
+
CJS dist/components/copilot-provider/index.js.map 27.64 KB
|
|
69
|
+
CJS dist/hooks/use-flat-category-store.js.map 4.25 KB
|
|
70
|
+
CJS dist/openai-assistants/utils/process-message-stream.js.map 1.33 KB
|
|
71
|
+
CJS dist/components/copilot-provider/copilotkit.js.map 27.45 KB
|
|
72
|
+
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js.map 20.61 KB
|
|
73
|
+
CJS ⚡️ Build success in 36ms
|
|
31
74
|
ESM dist/index.mjs 1.52 KB
|
|
32
|
-
ESM dist/
|
|
33
|
-
ESM dist/
|
|
75
|
+
ESM dist/components/index.mjs 407.00 B
|
|
76
|
+
ESM dist/context/index.mjs 227.00 B
|
|
77
|
+
ESM dist/hooks/index.mjs 769.00 B
|
|
78
|
+
ESM dist/chunk-4LKP4DMT.mjs 4.39 KB
|
|
34
79
|
ESM dist/chunk-LUGEI4YQ.mjs 43.00 B
|
|
35
|
-
ESM dist/hooks/use-make-copilot-readable.mjs 235.00 B
|
|
36
|
-
ESM dist/chunk-7GFKOIO7.mjs 43.00 B
|
|
37
80
|
ESM dist/chunk-MZ5UN3BY.mjs 802.00 B
|
|
38
81
|
ESM dist/chunk-FRAKUJWH.mjs 43.00 B
|
|
39
|
-
ESM dist/components/index.mjs 407.00 B
|
|
40
|
-
ESM dist/openai-assistants/index.mjs 597.00 B
|
|
41
82
|
ESM dist/context/copilot-context.mjs 219.00 B
|
|
83
|
+
ESM dist/chunk-7GFKOIO7.mjs 43.00 B
|
|
42
84
|
ESM dist/chunk-VNRDQJXW.mjs 43.00 B
|
|
43
|
-
ESM dist/chunk-BABVSMJR.mjs 43.00 B
|
|
44
|
-
ESM dist/hooks/index.mjs 769.00 B
|
|
45
|
-
ESM dist/context/index.mjs 227.00 B
|
|
46
85
|
ESM dist/chunk-XBLCD24W.mjs 700.00 B
|
|
86
|
+
ESM dist/chunk-TZPIY754.mjs 3.17 KB
|
|
47
87
|
ESM dist/chunk-CPEUPJQJ.mjs 640.00 B
|
|
48
88
|
ESM dist/hooks/use-copilot-chat.mjs 500.00 B
|
|
49
|
-
ESM dist/
|
|
50
|
-
ESM dist/chunk-
|
|
51
|
-
ESM dist/chunk-
|
|
52
|
-
ESM dist/
|
|
89
|
+
ESM dist/chunk-K2LVBFRY.mjs 970.00 B
|
|
90
|
+
ESM dist/chunk-EFZPSZWO.mjs 43.00 B
|
|
91
|
+
ESM dist/chunk-AVLJ3AWG.mjs 2.89 KB
|
|
92
|
+
ESM dist/hooks/use-chat.mjs 174.00 B
|
|
53
93
|
ESM dist/chunk-KAZJPE2I.mjs 4.55 KB
|
|
54
|
-
ESM dist/chunk-
|
|
55
|
-
ESM dist/chunk-VUY2K2DI.mjs 3.89 KB
|
|
94
|
+
ESM dist/chunk-SPCZTZCY.mjs 43.00 B
|
|
56
95
|
ESM dist/chunk-F2JIAPZQ.mjs 405.00 B
|
|
57
|
-
ESM dist/chunk-
|
|
58
|
-
ESM dist/
|
|
96
|
+
ESM dist/chunk-VUY2K2DI.mjs 3.89 KB
|
|
97
|
+
ESM dist/chunk-BABVSMJR.mjs 43.00 B
|
|
98
|
+
ESM dist/chunk-4OWTRVNI.mjs 1.42 KB
|
|
59
99
|
ESM dist/chunk-JIKWSWIX.mjs 2.35 KB
|
|
60
|
-
ESM dist/chunk-K2LVBFRY.mjs 970.00 B
|
|
61
100
|
ESM dist/chunk-5UGLWBZJ.mjs 43.00 B
|
|
62
|
-
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
63
|
-
ESM dist/hooks/use-flat-category-store.mjs 216.00 B
|
|
64
101
|
ESM dist/chunk-YULKJPY3.mjs 1.84 KB
|
|
65
|
-
ESM dist/
|
|
66
|
-
ESM dist/
|
|
102
|
+
ESM dist/hooks/use-flat-category-store.mjs 216.00 B
|
|
103
|
+
ESM dist/chunk-JD7BAH7U.mjs 43.00 B
|
|
104
|
+
ESM dist/chunk-NW27C3BV.mjs 5.04 KB
|
|
105
|
+
ESM dist/chunk-MRXNTQOX.mjs 1.89 KB
|
|
106
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs 201.00 B
|
|
107
|
+
ESM dist/openai-assistants/hooks/index.mjs 548.00 B
|
|
108
|
+
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs 575.00 B
|
|
109
|
+
ESM dist/types/index.mjs 66.00 B
|
|
110
|
+
ESM dist/openai-assistants/utils/process-message-stream.mjs 188.00 B
|
|
67
111
|
ESM dist/openai-assistants/hooks/use-assistants.mjs 2.59 KB
|
|
112
|
+
ESM dist/utils/utils.mjs 34.00 B
|
|
113
|
+
ESM dist/utils/utils.test.mjs 170.00 B
|
|
114
|
+
ESM dist/components/copilot-provider/index.mjs 396.00 B
|
|
115
|
+
ESM dist/types/system-message.mjs 43.00 B
|
|
116
|
+
ESM dist/openai-assistants/utils/index.mjs 206.00 B
|
|
117
|
+
ESM dist/hooks/use-make-copilot-readable.mjs 235.00 B
|
|
118
|
+
ESM dist/openai-assistants/index.mjs 597.00 B
|
|
119
|
+
ESM dist/hooks/use-make-copilot-actionable.mjs 241.00 B
|
|
120
|
+
ESM dist/lib/copilot-task.mjs 410.00 B
|
|
121
|
+
ESM dist/components/copilot-provider/copilotkit.mjs 380.00 B
|
|
122
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs 59.00 B
|
|
123
|
+
ESM dist/types/document-pointer.mjs 45.00 B
|
|
124
|
+
ESM dist/utils/fetch-chat-completion.mjs 319.00 B
|
|
125
|
+
ESM dist/hooks/use-make-copilot-document-readable.mjs 260.00 B
|
|
126
|
+
ESM dist/lib/index.mjs 435.00 B
|
|
68
127
|
ESM dist/hooks/use-tree.mjs 171.00 B
|
|
69
|
-
ESM dist/components/
|
|
70
|
-
ESM dist/
|
|
71
|
-
ESM dist/
|
|
72
|
-
ESM dist/
|
|
73
|
-
ESM dist/types/index.mjs.map 71.00 B
|
|
74
|
-
ESM dist/utils/utils.test.mjs.map 352.00 B
|
|
75
|
-
ESM dist/utils/fetch-chat-completion.mjs.map 71.00 B
|
|
76
|
-
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map 71.00 B
|
|
77
|
-
ESM dist/utils/utils.mjs.map 71.00 B
|
|
78
|
-
ESM dist/components/copilot-provider/copilotkit.mjs.map 71.00 B
|
|
79
|
-
ESM dist/components/copilot-provider/copilotkit-props.mjs.map 71.00 B
|
|
80
|
-
ESM dist/hooks/use-make-copilot-actionable.mjs.map 71.00 B
|
|
81
|
-
ESM dist/components/copilot-provider/index.mjs.map 71.00 B
|
|
82
|
-
ESM dist/hooks/use-make-copilot-document-readable.mjs.map 71.00 B
|
|
83
|
-
ESM dist/types/document-pointer.mjs.map 71.00 B
|
|
84
|
-
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
85
|
-
ESM dist/chunk-TZPIY754.mjs.map 5.55 KB
|
|
128
|
+
ESM dist/components/index.mjs.map 71.00 B
|
|
129
|
+
ESM dist/index.mjs.map 71.00 B
|
|
130
|
+
ESM dist/context/index.mjs.map 71.00 B
|
|
131
|
+
ESM dist/hooks/index.mjs.map 71.00 B
|
|
86
132
|
ESM dist/chunk-LUGEI4YQ.mjs.map 71.00 B
|
|
87
|
-
ESM dist/
|
|
133
|
+
ESM dist/chunk-4LKP4DMT.mjs.map 7.90 KB
|
|
88
134
|
ESM dist/chunk-7GFKOIO7.mjs.map 71.00 B
|
|
89
|
-
ESM dist/chunk-MZ5UN3BY.mjs.map 1.26 KB
|
|
90
|
-
ESM dist/chunk-FRAKUJWH.mjs.map 71.00 B
|
|
91
|
-
ESM dist/index.mjs.map 71.00 B
|
|
92
|
-
ESM dist/components/index.mjs.map 71.00 B
|
|
93
|
-
ESM dist/openai-assistants/index.mjs.map 71.00 B
|
|
94
135
|
ESM dist/context/copilot-context.mjs.map 71.00 B
|
|
136
|
+
ESM dist/chunk-MZ5UN3BY.mjs.map 1.26 KB
|
|
137
|
+
ESM dist/chunk-TZPIY754.mjs.map 5.55 KB
|
|
138
|
+
ESM dist/chunk-CPEUPJQJ.mjs.map 1.47 KB
|
|
95
139
|
ESM dist/chunk-VNRDQJXW.mjs.map 71.00 B
|
|
96
|
-
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
97
|
-
ESM dist/hooks/index.mjs.map 71.00 B
|
|
98
|
-
ESM dist/context/index.mjs.map 71.00 B
|
|
99
|
-
ESM dist/chunk-XBLCD24W.mjs.map 1.42 KB
|
|
100
140
|
ESM dist/hooks/use-copilot-chat.mjs.map 71.00 B
|
|
101
|
-
ESM dist/
|
|
102
|
-
ESM dist/chunk-
|
|
141
|
+
ESM dist/chunk-XBLCD24W.mjs.map 1.42 KB
|
|
142
|
+
ESM dist/chunk-K2LVBFRY.mjs.map 1.66 KB
|
|
143
|
+
ESM dist/chunk-FRAKUJWH.mjs.map 71.00 B
|
|
103
144
|
ESM dist/chunk-SPCZTZCY.mjs.map 71.00 B
|
|
104
|
-
ESM dist/chunk-KAZJPE2I.mjs.map 9.62 KB
|
|
105
|
-
ESM dist/chunk-4LKP4DMT.mjs.map 7.90 KB
|
|
106
|
-
ESM dist/chunk-4OWTRVNI.mjs.map 4.35 KB
|
|
107
145
|
ESM dist/chunk-VUY2K2DI.mjs.map 8.27 KB
|
|
108
146
|
ESM dist/chunk-F2JIAPZQ.mjs.map 1.12 KB
|
|
109
|
-
ESM dist/
|
|
147
|
+
ESM dist/chunk-KAZJPE2I.mjs.map 9.62 KB
|
|
148
|
+
ESM dist/chunk-EFZPSZWO.mjs.map 71.00 B
|
|
110
149
|
ESM dist/chunk-JIKWSWIX.mjs.map 3.98 KB
|
|
111
|
-
ESM dist/chunk-
|
|
150
|
+
ESM dist/chunk-BABVSMJR.mjs.map 71.00 B
|
|
151
|
+
ESM dist/chunk-AVLJ3AWG.mjs.map 4.59 KB
|
|
112
152
|
ESM dist/chunk-5UGLWBZJ.mjs.map 71.00 B
|
|
153
|
+
ESM dist/chunk-4OWTRVNI.mjs.map 4.35 KB
|
|
113
154
|
ESM dist/hooks/use-flat-category-store.mjs.map 71.00 B
|
|
114
|
-
ESM dist/
|
|
155
|
+
ESM dist/hooks/use-chat.mjs.map 71.00 B
|
|
156
|
+
ESM dist/chunk-JD7BAH7U.mjs.map 71.00 B
|
|
115
157
|
ESM dist/chunk-YULKJPY3.mjs.map 4.21 KB
|
|
116
|
-
ESM dist/
|
|
158
|
+
ESM dist/chunk-NW27C3BV.mjs.map 11.29 KB
|
|
159
|
+
ESM dist/chunk-MRXNTQOX.mjs.map 71.00 B
|
|
160
|
+
ESM dist/components/copilot-provider/standard-copilot-api-config.mjs.map 71.00 B
|
|
161
|
+
ESM dist/openai-assistants/hooks/use-copilot-chat-v2.mjs.map 71.00 B
|
|
162
|
+
ESM dist/utils/utils.mjs.map 71.00 B
|
|
117
163
|
ESM dist/openai-assistants/hooks/use-assistants.mjs.map 4.67 KB
|
|
118
|
-
ESM dist/
|
|
164
|
+
ESM dist/utils/utils.test.mjs.map 352.00 B
|
|
165
|
+
ESM dist/components/copilot-provider/index.mjs.map 71.00 B
|
|
119
166
|
ESM dist/openai-assistants/utils/index.mjs.map 71.00 B
|
|
120
|
-
ESM dist/
|
|
121
|
-
ESM dist/
|
|
167
|
+
ESM dist/openai-assistants/index.mjs.map 71.00 B
|
|
168
|
+
ESM dist/hooks/use-make-copilot-readable.mjs.map 71.00 B
|
|
169
|
+
ESM dist/hooks/use-make-copilot-actionable.mjs.map 71.00 B
|
|
170
|
+
ESM dist/components/copilot-provider/copilotkit-props.mjs.map 71.00 B
|
|
171
|
+
ESM dist/types/system-message.mjs.map 71.00 B
|
|
172
|
+
ESM dist/lib/copilot-task.mjs.map 71.00 B
|
|
173
|
+
ESM dist/components/copilot-provider/copilotkit.mjs.map 71.00 B
|
|
174
|
+
ESM dist/types/index.mjs.map 71.00 B
|
|
175
|
+
ESM dist/openai-assistants/hooks/index.mjs.map 71.00 B
|
|
176
|
+
ESM dist/openai-assistants/utils/process-message-stream.mjs.map 71.00 B
|
|
177
|
+
ESM dist/utils/fetch-chat-completion.mjs.map 71.00 B
|
|
178
|
+
ESM dist/lib/index.mjs.map 71.00 B
|
|
179
|
+
ESM dist/types/document-pointer.mjs.map 71.00 B
|
|
180
|
+
ESM dist/hooks/use-make-copilot-document-readable.mjs.map 71.00 B
|
|
122
181
|
ESM dist/hooks/use-tree.mjs.map 71.00 B
|
|
123
|
-
ESM ⚡️ Build success in
|
|
124
|
-
CJS dist/index.js 34.54 KB
|
|
125
|
-
CJS dist/components/index.js 15.12 KB
|
|
126
|
-
CJS dist/context/copilot-context.js 3.62 KB
|
|
127
|
-
CJS dist/context/index.js 3.60 KB
|
|
128
|
-
CJS dist/hooks/index.js 15.21 KB
|
|
129
|
-
CJS dist/hooks/use-make-copilot-document-readable.js 4.22 KB
|
|
130
|
-
CJS dist/hooks/use-make-copilot-actionable.js 4.47 KB
|
|
131
|
-
CJS dist/hooks/use-flat-category-store.js 2.87 KB
|
|
132
|
-
CJS dist/hooks/use-make-copilot-readable.js 4.10 KB
|
|
133
|
-
CJS dist/lib/copilot-task.js 7.17 KB
|
|
134
|
-
CJS dist/types/index.js 797.00 B
|
|
135
|
-
CJS dist/lib/index.js 7.13 KB
|
|
136
|
-
CJS dist/openai-assistants/index.js 9.31 KB
|
|
137
|
-
CJS dist/utils/utils.test.js 184.00 B
|
|
138
|
-
CJS dist/utils/utils.js 797.00 B
|
|
139
|
-
CJS dist/components/copilot-provider/copilotkit-props.js 878.00 B
|
|
140
|
-
CJS dist/components/copilot-provider/copilotkit.js 15.11 KB
|
|
141
|
-
CJS dist/types/document-pointer.js 841.00 B
|
|
142
|
-
CJS dist/types/system-message.js 833.00 B
|
|
143
|
-
CJS dist/openai-assistants/utils/index.js 2.30 KB
|
|
144
|
-
CJS dist/components/copilot-provider/standard-copilot-api-config.js 1.48 KB
|
|
145
|
-
CJS dist/openai-assistants/utils/process-message-stream.js 2.33 KB
|
|
146
|
-
CJS dist/hooks/use-chat.js 7.81 KB
|
|
147
|
-
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js 9.30 KB
|
|
148
|
-
CJS dist/hooks/use-tree.js 5.53 KB
|
|
149
|
-
CJS dist/hooks/use-copilot-chat.js 13.04 KB
|
|
150
|
-
CJS dist/openai-assistants/hooks/use-assistants.js 4.82 KB
|
|
151
|
-
CJS dist/utils/fetch-chat-completion.js 4.78 KB
|
|
152
|
-
CJS dist/components/copilot-provider/index.js 15.16 KB
|
|
153
|
-
CJS dist/openai-assistants/hooks/index.js 9.21 KB
|
|
154
|
-
CJS dist/components/index.js.map 27.51 KB
|
|
155
|
-
CJS dist/context/copilot-context.js.map 4.44 KB
|
|
156
|
-
CJS dist/context/index.js.map 4.67 KB
|
|
157
|
-
CJS dist/hooks/index.js.map 33.45 KB
|
|
158
|
-
CJS dist/hooks/use-make-copilot-document-readable.js.map 5.75 KB
|
|
159
|
-
CJS dist/hooks/use-make-copilot-actionable.js.map 5.98 KB
|
|
160
|
-
CJS dist/hooks/use-make-copilot-readable.js.map 5.79 KB
|
|
161
|
-
CJS dist/hooks/use-flat-category-store.js.map 4.25 KB
|
|
162
|
-
CJS dist/types/index.js.map 253.00 B
|
|
163
|
-
CJS dist/lib/index.js.map 16.46 KB
|
|
164
|
-
CJS dist/openai-assistants/index.js.map 20.70 KB
|
|
165
|
-
CJS dist/index.js.map 64.08 KB
|
|
166
|
-
CJS dist/utils/utils.js.map 137.00 B
|
|
167
|
-
CJS dist/utils/utils.test.js.map 354.00 B
|
|
168
|
-
CJS dist/components/copilot-provider/copilotkit-props.js.map 894.00 B
|
|
169
|
-
CJS dist/components/copilot-provider/copilotkit.js.map 27.45 KB
|
|
170
|
-
CJS dist/types/document-pointer.js.map 292.00 B
|
|
171
|
-
CJS dist/types/system-message.js.map 249.00 B
|
|
172
|
-
CJS dist/openai-assistants/utils/index.js.map 1.44 KB
|
|
173
|
-
CJS dist/components/copilot-provider/standard-copilot-api-config.js.map 1.17 KB
|
|
174
|
-
CJS dist/openai-assistants/utils/process-message-stream.js.map 1.33 KB
|
|
175
|
-
CJS dist/hooks/use-chat.js.map 12.54 KB
|
|
176
|
-
CJS dist/openai-assistants/hooks/use-copilot-chat-v2.js.map 20.61 KB
|
|
177
|
-
CJS dist/hooks/use-tree.js.map 8.32 KB
|
|
178
|
-
CJS dist/hooks/use-copilot-chat.js.map 28.54 KB
|
|
179
|
-
CJS dist/utils/fetch-chat-completion.js.map 4.03 KB
|
|
180
|
-
CJS dist/components/copilot-provider/index.js.map 27.64 KB
|
|
181
|
-
CJS dist/lib/copilot-task.js.map 16.40 KB
|
|
182
|
-
CJS dist/openai-assistants/hooks/use-assistants.js.map 5.92 KB
|
|
183
|
-
CJS dist/openai-assistants/hooks/index.js.map 21.00 KB
|
|
184
|
-
CJS ⚡️ Build success in 128ms
|
|
182
|
+
ESM ⚡️ Build success in 39ms
|
|
185
183
|
DTS Build start
|
|
186
|
-
DTS ⚡️ Build success in
|
|
184
|
+
DTS ⚡️ Build success in 2680ms
|
|
187
185
|
DTS dist/index.d.ts 1.41 KB
|
|
188
186
|
DTS dist/components/copilot-provider/copilotkit.d.ts 1.26 KB
|
|
189
187
|
DTS dist/components/copilot-provider/copilotkit-props.d.ts 749.00 B
|
|
@@ -211,8 +209,6 @@ DTS dist/utils/utils.test.d.ts 12.00 B
|
|
|
211
209
|
DTS dist/utils/utils.d.ts 12.00 B
|
|
212
210
|
DTS dist/components/copilot-provider/index.d.ts 152.00 B
|
|
213
211
|
DTS dist/components/copilot-provider/standard-copilot-api-config.d.ts 834.00 B
|
|
214
|
-
DTS dist/openai-assistants/utils/index.d.ts 68.00 B
|
|
215
212
|
DTS dist/openai-assistants/hooks/index.d.ts 182.00 B
|
|
216
213
|
DTS dist/openai-assistants/hooks/use-assistants.d.ts 551.00 B
|
|
217
|
-
|
|
218
|
-
Waiting for the debugger to disconnect...
|
|
214
|
+
DTS dist/openai-assistants/utils/index.d.ts 68.00 B
|
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
# ui
|
|
2
2
|
|
|
3
|
-
## 0.20.0-
|
|
3
|
+
## 0.20.0-tools.1
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- function return
|
|
8
8
|
|
|
9
9
|
### Patch Changes
|
|
10
10
|
|
|
11
11
|
- Updated dependencies
|
|
12
|
-
- @copilotkit/shared@0.4.0-
|
|
13
|
-
|
|
14
|
-
## 0.20.0-demofixes.1
|
|
15
|
-
|
|
16
|
-
### Minor Changes
|
|
17
|
-
|
|
18
|
-
- helloworld to presentation, refactor audio gen to util
|
|
19
|
-
|
|
20
|
-
### Patch Changes
|
|
21
|
-
|
|
22
|
-
- Updated dependencies
|
|
23
|
-
- @copilotkit/shared@0.4.0-demofixes.1
|
|
12
|
+
- @copilotkit/shared@0.4.0-tools.1
|
|
24
13
|
|
|
25
14
|
## 0.20.0-tools.0
|
|
26
15
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-4OWTRVNI.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useChat
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NW27C3BV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__objRest,
|
|
12
12
|
__spreadProps,
|
|
@@ -91,4 +91,4 @@ export {
|
|
|
91
91
|
useCopilotChat,
|
|
92
92
|
defaultSystemMessage
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=chunk-
|
|
94
|
+
//# sourceMappingURL=chunk-AVLJ3AWG.mjs.map
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
// src/hooks/use-chat.ts
|
|
9
9
|
import { useRef, useState } from "react";
|
|
10
|
+
import { encodeResult } from "@copilotkit/shared";
|
|
10
11
|
import { nanoid } from "nanoid";
|
|
11
12
|
function useChat(options) {
|
|
12
13
|
const [messages, setMessages] = useState([]);
|
|
@@ -14,7 +15,6 @@ function useChat(options) {
|
|
|
14
15
|
const [isLoading, setIsLoading] = useState(false);
|
|
15
16
|
const abortControllerRef = useRef();
|
|
16
17
|
const runChatCompletion = (messages2) => __async(this, null, function* () {
|
|
17
|
-
var _a;
|
|
18
18
|
setIsLoading(true);
|
|
19
19
|
const newMessages = [
|
|
20
20
|
{
|
|
@@ -39,15 +39,16 @@ function useChat(options) {
|
|
|
39
39
|
throw new Error("Failed to fetch chat completion");
|
|
40
40
|
}
|
|
41
41
|
const reader = response.events.getReader();
|
|
42
|
+
let feedback = false;
|
|
42
43
|
try {
|
|
43
44
|
while (true) {
|
|
44
45
|
const { done, value } = yield reader.read();
|
|
45
46
|
if (done) {
|
|
46
|
-
|
|
47
|
+
break;
|
|
47
48
|
}
|
|
48
49
|
let currentMessage = Object.assign({}, newMessages[newMessages.length - 1]);
|
|
49
50
|
if (value.type === "content") {
|
|
50
|
-
if (currentMessage.function_call) {
|
|
51
|
+
if (currentMessage.function_call || currentMessage.role === "function") {
|
|
51
52
|
currentMessage = {
|
|
52
53
|
id: nanoid(),
|
|
53
54
|
createdAt: /* @__PURE__ */ new Date(),
|
|
@@ -59,8 +60,18 @@ function useChat(options) {
|
|
|
59
60
|
currentMessage.content += value.content;
|
|
60
61
|
newMessages[newMessages.length - 1] = currentMessage;
|
|
61
62
|
setMessages([...messages2, ...newMessages]);
|
|
63
|
+
} else if (value.type === "result") {
|
|
64
|
+
currentMessage = {
|
|
65
|
+
id: nanoid(),
|
|
66
|
+
role: "function",
|
|
67
|
+
content: value.content,
|
|
68
|
+
name: value.name
|
|
69
|
+
};
|
|
70
|
+
newMessages.push(currentMessage);
|
|
71
|
+
setMessages([...messages2, ...newMessages]);
|
|
72
|
+
feedback = true;
|
|
62
73
|
} else if (value.type === "function") {
|
|
63
|
-
if (currentMessage.content != "" || currentMessage.function_call) {
|
|
74
|
+
if (currentMessage.content != "" || currentMessage.function_call || currentMessage.role == "function") {
|
|
64
75
|
currentMessage = {
|
|
65
76
|
id: nanoid(),
|
|
66
77
|
createdAt: /* @__PURE__ */ new Date(),
|
|
@@ -71,13 +82,34 @@ function useChat(options) {
|
|
|
71
82
|
}
|
|
72
83
|
currentMessage.function_call = {
|
|
73
84
|
name: value.name,
|
|
74
|
-
arguments: JSON.stringify(value.arguments)
|
|
85
|
+
arguments: JSON.stringify(value.arguments),
|
|
86
|
+
scope: value.scope
|
|
75
87
|
};
|
|
76
88
|
newMessages[newMessages.length - 1] = currentMessage;
|
|
77
89
|
setMessages([...messages2, ...newMessages]);
|
|
78
|
-
|
|
90
|
+
try {
|
|
91
|
+
if (options.onFunctionCall && value.scope === "client") {
|
|
92
|
+
const result = yield options.onFunctionCall(messages2, currentMessage.function_call);
|
|
93
|
+
currentMessage = {
|
|
94
|
+
id: nanoid(),
|
|
95
|
+
role: "function",
|
|
96
|
+
content: encodeResult(result),
|
|
97
|
+
name: currentMessage.function_call.name
|
|
98
|
+
};
|
|
99
|
+
newMessages.push(currentMessage);
|
|
100
|
+
setMessages([...messages2, ...newMessages]);
|
|
101
|
+
feedback = true;
|
|
102
|
+
}
|
|
103
|
+
} catch (error) {
|
|
104
|
+
console.error("Failed to execute function call", error);
|
|
105
|
+
}
|
|
79
106
|
}
|
|
80
107
|
}
|
|
108
|
+
if (feedback) {
|
|
109
|
+
return yield runChatCompletion([...messages2, ...newMessages]);
|
|
110
|
+
} else {
|
|
111
|
+
return newMessages.slice();
|
|
112
|
+
}
|
|
81
113
|
} finally {
|
|
82
114
|
setIsLoading(false);
|
|
83
115
|
}
|
|
@@ -123,4 +155,4 @@ function useChat(options) {
|
|
|
123
155
|
export {
|
|
124
156
|
useChat
|
|
125
157
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
158
|
+
//# sourceMappingURL=chunk-NW27C3BV.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/hooks/use-chat.ts"],"sourcesContent":["import { useRef, useState } from \"react\";\nimport { Message, ToolDefinition, FunctionCallHandler, encodeResult } from \"@copilotkit/shared\";\nimport { nanoid } from \"nanoid\";\nimport { fetchAndDecodeChatCompletion } from \"../utils/fetch-chat-completion\";\nimport { CopilotApiConfig } from \"../context\";\n\nexport type UseChatOptions = {\n /**\n * The API endpoint that accepts a `{ messages: Message[] }` object and returns\n * a stream of tokens of the AI chat response. Defaults to `/api/chat`.\n */\n api?: string;\n /**\n * A unique identifier for the chat. If not provided, a random one will be\n * generated. When provided, the `useChat` hook with the same `id` will\n * have shared states across components.\n */\n id?: string;\n /**\n * System messages of the chat. Defaults to an empty array.\n */\n initialMessages?: Message[];\n /**\n * Callback function to be called when a function call is received.\n * If the function returns a `ChatRequest` object, the request will be sent\n * automatically to the API and will be used to update the chat.\n */\n onFunctionCall?: FunctionCallHandler;\n /**\n * HTTP headers to be sent with the API request.\n */\n headers?: Record<string, string> | Headers;\n /**\n * Extra body object to be sent with the API request.\n * @example\n * Send a `sessionId` to the API along with the messages.\n * ```js\n * useChat({\n * body: {\n * sessionId: '123',\n * }\n * })\n * ```\n */\n body?: object;\n /**\n * Function definitions to be sent to the API.\n */\n tools?: ToolDefinition[];\n};\n\nexport type UseChatHelpers = {\n /** Current messages in the chat */\n messages: Message[];\n /**\n * Append a user message to the chat list. This triggers the API call to fetch\n * the assistant's response.\n * @param message The message to append\n */\n append: (message: Message) => Promise<void>;\n /**\n * Reload the last AI chat response for the given chat history. If the last\n * message isn't from the assistant, it will request the API to generate a\n * new response.\n */\n reload: () => Promise<void>;\n /**\n * Abort the current request immediately, keep the generated tokens if any.\n */\n stop: () => void;\n /** The current value of the input */\n input: string;\n /** setState-powered method to update the input value */\n setInput: React.Dispatch<React.SetStateAction<string>>;\n /** Whether the API request is in progress */\n isLoading: boolean;\n};\n\nexport type UseChatOptionsWithCopilotConfig = UseChatOptions & {\n copilotConfig: CopilotApiConfig;\n};\n\nexport function useChat(options: UseChatOptionsWithCopilotConfig): UseChatHelpers {\n const [messages, setMessages] = useState<Message[]>([]);\n const [input, setInput] = useState(\"\");\n const [isLoading, setIsLoading] = useState(false);\n const abortControllerRef = useRef<AbortController>();\n\n const runChatCompletion = async (messages: Message[]): Promise<Message[]> => {\n setIsLoading(true);\n\n const newMessages: Message[] = [\n {\n id: nanoid(),\n createdAt: new Date(),\n content: \"\",\n role: \"assistant\",\n },\n ];\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n\n setMessages([...messages, ...newMessages]);\n\n const messagesWithContext = [...(options.initialMessages || []), ...messages];\n const response = await fetchAndDecodeChatCompletion({\n copilotConfig: options.copilotConfig,\n messages: messagesWithContext,\n tools: options.tools,\n headers: options.headers,\n signal: abortController.signal,\n });\n\n if (!response.events) {\n throw new Error(\"Failed to fetch chat completion\");\n }\n\n const reader = response.events.getReader();\n\n // Whether to feed back the new messages to GPT\n let feedback = false;\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n\n if (done) {\n break;\n }\n\n let currentMessage = Object.assign({}, newMessages[newMessages.length - 1]);\n\n if (value.type === \"content\") {\n if (currentMessage.function_call || currentMessage.role === \"function\") {\n // Create a new message if the previous one is a function call or result\n currentMessage = {\n id: nanoid(),\n createdAt: new Date(),\n content: \"\",\n role: \"assistant\",\n };\n newMessages.push(currentMessage);\n }\n currentMessage.content += value.content;\n newMessages[newMessages.length - 1] = currentMessage;\n setMessages([...messages, ...newMessages]);\n } else if (value.type === \"result\") {\n // When we get a result message, it is already complete\n currentMessage = {\n id: nanoid(),\n role: \"function\",\n content: value.content,\n name: value.name,\n };\n newMessages.push(currentMessage);\n setMessages([...messages, ...newMessages]);\n\n // After receiving a result, feed back the new messages to GPT\n feedback = true;\n } else if (value.type === \"function\") {\n // Create a new message if the previous one is not empty\n if (\n currentMessage.content != \"\" ||\n currentMessage.function_call ||\n currentMessage.role == \"function\"\n ) {\n currentMessage = {\n id: nanoid(),\n createdAt: new Date(),\n content: \"\",\n role: \"assistant\",\n };\n newMessages.push(currentMessage);\n }\n currentMessage.function_call = {\n name: value.name,\n arguments: JSON.stringify(value.arguments),\n scope: value.scope,\n };\n\n newMessages[newMessages.length - 1] = currentMessage;\n setMessages([...messages, ...newMessages]);\n\n // Execute the function call\n try {\n if (options.onFunctionCall && value.scope === \"client\") {\n const result = await options.onFunctionCall(messages, currentMessage.function_call);\n\n currentMessage = {\n id: nanoid(),\n role: \"function\",\n content: encodeResult(result),\n name: currentMessage.function_call!.name!,\n };\n newMessages.push(currentMessage);\n setMessages([...messages, ...newMessages]);\n\n // After a function call, feed back the new messages to GPT\n feedback = true;\n }\n } catch (error) {\n console.error(\"Failed to execute function call\", error);\n // TODO: Handle error\n // this should go to the message itself\n }\n }\n }\n\n // If we want feedback, run the completion again and return the results\n if (feedback) {\n return await runChatCompletion([...messages, ...newMessages]);\n }\n // otherwise, return the new messages\n else {\n return newMessages.slice();\n }\n } finally {\n setIsLoading(false);\n }\n };\n\n const runChatCompletionAndHandleFunctionCall = async (messages: Message[]): Promise<void> => {\n await runChatCompletion(messages);\n };\n\n const append = async (message: Message): Promise<void> => {\n if (isLoading) {\n return;\n }\n const newMessages = [...messages, message];\n setMessages(newMessages);\n return runChatCompletionAndHandleFunctionCall(newMessages);\n };\n\n const reload = async (): Promise<void> => {\n if (isLoading || messages.length === 0) {\n return;\n }\n let newMessages = [...messages];\n const lastMessage = messages[messages.length - 1];\n\n if (lastMessage.role === \"assistant\") {\n newMessages = newMessages.slice(0, -1);\n }\n setMessages(newMessages);\n\n return runChatCompletionAndHandleFunctionCall(newMessages);\n };\n\n const stop = (): void => {\n abortControllerRef.current?.abort();\n };\n\n return {\n messages,\n append,\n reload,\n stop,\n isLoading,\n input,\n setInput,\n };\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,QAAQ,gBAAgB;AACjC,SAAuD,oBAAoB;AAC3E,SAAS,cAAc;AAgFhB,SAAS,QAAQ,SAA0D;AAChF,QAAM,CAAC,UAAU,WAAW,IAAI,SAAoB,CAAC,CAAC;AACtD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,qBAAqB,OAAwB;AAEnD,QAAM,oBAAoB,CAAOA,cAA4C;AAC3E,iBAAa,IAAI;AAEjB,UAAM,cAAyB;AAAA,MAC7B;AAAA,QACE,IAAI,OAAO;AAAA,QACX,WAAW,oBAAI,KAAK;AAAA,QACpB,SAAS;AAAA,QACT,MAAM;AAAA,MACR;AAAA,IACF;AACA,UAAM,kBAAkB,IAAI,gBAAgB;AAC5C,uBAAmB,UAAU;AAE7B,gBAAY,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAEzC,UAAM,sBAAsB,CAAC,GAAI,QAAQ,mBAAmB,CAAC,GAAI,GAAGA,SAAQ;AAC5E,UAAM,WAAW,MAAM,6BAA6B;AAAA,MAClD,eAAe,QAAQ;AAAA,MACvB,UAAU;AAAA,MACV,OAAO,QAAQ;AAAA,MACf,SAAS,QAAQ;AAAA,MACjB,QAAQ,gBAAgB;AAAA,IAC1B,CAAC;AAED,QAAI,CAAC,SAAS,QAAQ;AACpB,YAAM,IAAI,MAAM,iCAAiC;AAAA,IACnD;AAEA,UAAM,SAAS,SAAS,OAAO,UAAU;AAGzC,QAAI,WAAW;AAEf,QAAI;AACF,aAAO,MAAM;AACX,cAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAE1C,YAAI,MAAM;AACR;AAAA,QACF;AAEA,YAAI,iBAAiB,OAAO,OAAO,CAAC,GAAG,YAAY,YAAY,SAAS,CAAC,CAAC;AAE1E,YAAI,MAAM,SAAS,WAAW;AAC5B,cAAI,eAAe,iBAAiB,eAAe,SAAS,YAAY;AAEtE,6BAAiB;AAAA,cACf,IAAI,OAAO;AAAA,cACX,WAAW,oBAAI,KAAK;AAAA,cACpB,SAAS;AAAA,cACT,MAAM;AAAA,YACR;AACA,wBAAY,KAAK,cAAc;AAAA,UACjC;AACA,yBAAe,WAAW,MAAM;AAChC,sBAAY,YAAY,SAAS,CAAC,IAAI;AACtC,sBAAY,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAAA,QAC3C,WAAW,MAAM,SAAS,UAAU;AAElC,2BAAiB;AAAA,YACf,IAAI,OAAO;AAAA,YACX,MAAM;AAAA,YACN,SAAS,MAAM;AAAA,YACf,MAAM,MAAM;AAAA,UACd;AACA,sBAAY,KAAK,cAAc;AAC/B,sBAAY,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAGzC,qBAAW;AAAA,QACb,WAAW,MAAM,SAAS,YAAY;AAEpC,cACE,eAAe,WAAW,MAC1B,eAAe,iBACf,eAAe,QAAQ,YACvB;AACA,6BAAiB;AAAA,cACf,IAAI,OAAO;AAAA,cACX,WAAW,oBAAI,KAAK;AAAA,cACpB,SAAS;AAAA,cACT,MAAM;AAAA,YACR;AACA,wBAAY,KAAK,cAAc;AAAA,UACjC;AACA,yBAAe,gBAAgB;AAAA,YAC7B,MAAM,MAAM;AAAA,YACZ,WAAW,KAAK,UAAU,MAAM,SAAS;AAAA,YACzC,OAAO,MAAM;AAAA,UACf;AAEA,sBAAY,YAAY,SAAS,CAAC,IAAI;AACtC,sBAAY,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAGzC,cAAI;AACF,gBAAI,QAAQ,kBAAkB,MAAM,UAAU,UAAU;AACtD,oBAAM,SAAS,MAAM,QAAQ,eAAeA,WAAU,eAAe,aAAa;AAElF,+BAAiB;AAAA,gBACf,IAAI,OAAO;AAAA,gBACX,MAAM;AAAA,gBACN,SAAS,aAAa,MAAM;AAAA,gBAC5B,MAAM,eAAe,cAAe;AAAA,cACtC;AACA,0BAAY,KAAK,cAAc;AAC/B,0BAAY,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAGzC,yBAAW;AAAA,YACb;AAAA,UACF,SAAS,OAAP;AACA,oBAAQ,MAAM,mCAAmC,KAAK;AAAA,UAGxD;AAAA,QACF;AAAA,MACF;AAGA,UAAI,UAAU;AACZ,eAAO,MAAM,kBAAkB,CAAC,GAAGA,WAAU,GAAG,WAAW,CAAC;AAAA,MAC9D,OAEK;AACH,eAAO,YAAY,MAAM;AAAA,MAC3B;AAAA,IACF,UAAE;AACA,mBAAa,KAAK;AAAA,IACpB;AAAA,EACF;AAEA,QAAM,yCAAyC,CAAOA,cAAuC;AAC3F,UAAM,kBAAkBA,SAAQ;AAAA,EAClC;AAEA,QAAM,SAAS,CAAO,YAAoC;AACxD,QAAI,WAAW;AACb;AAAA,IACF;AACA,UAAM,cAAc,CAAC,GAAG,UAAU,OAAO;AACzC,gBAAY,WAAW;AACvB,WAAO,uCAAuC,WAAW;AAAA,EAC3D;AAEA,QAAM,SAAS,MAA2B;AACxC,QAAI,aAAa,SAAS,WAAW,GAAG;AACtC;AAAA,IACF;AACA,QAAI,cAAc,CAAC,GAAG,QAAQ;AAC9B,UAAM,cAAc,SAAS,SAAS,SAAS,CAAC;AAEhD,QAAI,YAAY,SAAS,aAAa;AACpC,oBAAc,YAAY,MAAM,GAAG,EAAE;AAAA,IACvC;AACA,gBAAY,WAAW;AAEvB,WAAO,uCAAuC,WAAW;AAAA,EAC3D;AAEA,QAAM,OAAO,MAAY;AAzP3B;AA0PI,6BAAmB,YAAnB,mBAA4B;AAAA,EAC9B;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["messages"]}
|