Skip to content

Commit 0c132c1

Browse files
committed
install dependencies
1 parent d1d9b92 commit 0c132c1

File tree

3 files changed

+1032
-16
lines changed

3 files changed

+1032
-16
lines changed

client/packages/lowcoder/package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
"main": "src/index.sdk.ts",
77
"types": "src/index.sdk.ts",
88
"dependencies": {
9+
"@ai-sdk/openai": "^1.3.22",
910
"@ant-design/icons": "^5.3.0",
11+
"@assistant-ui/react": "^0.10.24",
12+
"@assistant-ui/react-ai-sdk": "^0.10.14",
13+
"@assistant-ui/react-markdown": "^0.10.5",
14+
"@assistant-ui/styles": "^0.1.13",
1015
"@bany/curl-to-json": "^1.2.8",
1116
"@codemirror/autocomplete": "^6.11.1",
1217
"@codemirror/commands": "^6.3.2",
@@ -28,6 +33,8 @@
2833
"@jsonforms/core": "^3.5.1",
2934
"@lottiefiles/dotlottie-react": "^0.13.0",
3035
"@manaflair/redux-batch": "^1.0.0",
36+
"@radix-ui/react-slot": "^1.2.3",
37+
"@radix-ui/react-tooltip": "^1.2.7",
3138
"@rjsf/antd": "^5.24.9",
3239
"@rjsf/core": "^5.24.9",
3340
"@rjsf/utils": "^5.24.9",
@@ -37,6 +44,7 @@
3744
"@types/react-signature-canvas": "^1.0.2",
3845
"@types/react-test-renderer": "^18.0.0",
3946
"@types/react-virtualized": "^9.21.21",
47+
"ai": "^4.3.16",
4048
"alasql": "^4.6.6",
4149
"animate.css": "^4.1.1",
4250
"antd": "^5.25.2",
@@ -61,6 +69,7 @@
6169
"loglevel": "^1.8.0",
6270
"lowcoder-core": "workspace:^",
6371
"lowcoder-design": "workspace:^",
72+
"lucide-react": "^0.525.0",
6473
"mime": "^3.0.0",
6574
"moment": "^2.29.4",
6675
"numbro": "^2.3.6",
@@ -98,7 +107,7 @@
98107
"regenerator-runtime": "^0.13.9",
99108
"rehype-raw": "^6.1.1",
100109
"rehype-sanitize": "^5.0.1",
101-
"remark-gfm": "^4.0.0",
110+
"remark-gfm": "^4.0.1",
102111
"resize-observer-polyfill": "^1.5.1",
103112
"simplebar-react": "^3.2.4",
104113
"sql-formatter": "^8.2.0",

client/packages/lowcoder/src/comps/comps/chatComp/chatView.tsx

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,84 @@
22
import React from "react";
33
import { ChatCompProps } from "./chatCompTypes";
44

5+
// Import assistant-ui components and proper runtime
6+
import {
7+
AssistantRuntimeProvider,
8+
ThreadPrimitive,
9+
ComposerPrimitive
10+
} from "@assistant-ui/react";
11+
import { useChatRuntime } from "@assistant-ui/react-ai-sdk";
12+
import "@assistant-ui/styles/index.css";
13+
import "@assistant-ui/styles/markdown.css";
14+
515
export const ChatView = React.memo((props: ChatCompProps) => {
16+
// Create proper runtime using useChatRuntime
17+
const runtime = useChatRuntime({
18+
api: "/api/chat", // We'll create this endpoint later
19+
});
20+
621
return (
7-
<div style={{
8-
height: '100%',
9-
border: '1px solid #ccc',
10-
padding: '16px',
11-
borderRadius: '4px'
12-
}}>
13-
{props.text}
14-
</div>
22+
<AssistantRuntimeProvider runtime={runtime}>
23+
<div style={{
24+
height: '100%',
25+
padding: '16px',
26+
backgroundColor: '#f5f5f5'
27+
}}>
28+
<div className="aui-root">
29+
<h3 style={{ marginBottom: '16px' }}>🚀 Assistant-UI with Vercel AI SDK!</h3>
30+
31+
{/* Test Thread with real runtime */}
32+
<div className="aui-thread-root" style={{
33+
background: 'white',
34+
borderRadius: '8px',
35+
padding: '16px',
36+
marginBottom: '16px',
37+
border: '1px solid #e0e0e0',
38+
minHeight: '200px'
39+
}}>
40+
<ThreadPrimitive.Empty>
41+
<div className="aui-thread-welcome-root">
42+
<div className="aui-thread-welcome-center">
43+
<p className="aui-thread-welcome-message">
44+
{props.text} - Runtime Working! 🎉
45+
</p>
46+
</div>
47+
</div>
48+
</ThreadPrimitive.Empty>
49+
</div>
50+
51+
{/* Test Composer with real runtime */}
52+
<div className="aui-composer-root" style={{
53+
background: 'white',
54+
borderRadius: '8px',
55+
padding: '12px',
56+
border: '1px solid #e0e0e0'
57+
}}>
58+
<ComposerPrimitive.Input
59+
placeholder={props.text}
60+
disabled={false}
61+
className="aui-composer-input"
62+
rows={1}
63+
/>
64+
</div>
65+
66+
{/* Property status */}
67+
<div style={{
68+
marginTop: '16px',
69+
fontSize: '12px',
70+
color: '#666',
71+
background: 'white',
72+
padding: '8px',
73+
borderRadius: '4px',
74+
border: '1px solid #e0e0e0'
75+
}}>
76+
<strong>✅ Test Status:</strong><br/>
77+
Text: {props.text}<br/>
78+
Runtime: Vercel AI SDK ✅
79+
</div>
80+
</div>
81+
</div>
82+
</AssistantRuntimeProvider>
1583
);
1684
});
1785

0 commit comments

Comments
 (0)