File tree Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Expand file tree Collapse file tree 4 files changed +27
-10
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,16 @@ const messages: Record<string, AIMessage> = {
1212 id : '22222' ,
1313 role : 'assistant' ,
1414 status : 'error' ,
15+ content : [
16+ {
17+ type : 'text' ,
18+ data : '已经输出内容' ,
19+ } ,
20+ {
21+ type : 'text' ,
22+ data : '出错了' ,
23+ } ,
24+ ] ,
1525 } ,
1626} ;
1727
@@ -47,7 +57,12 @@ export default function ChatMessageExample() {
4757 status = { messages . loading . status }
4858 > </ ChatMessage >
4959 < Divider > 出错状态下的消息</ Divider >
50- < ChatMessage avatar = "https://tdesign.gtimg.com/site/chat-avatar.png" message = { messages . error } > </ ChatMessage >
60+ < ChatMessage
61+ avatar = "https://tdesign.gtimg.com/site/chat-avatar.png"
62+ role = "assistant"
63+ status = "error"
64+ content = { messages . error . content }
65+ > </ ChatMessage >
5166 </ Space >
5267 ) ;
5368}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const message = {
2121 id : '11111' ,
2222 role : 'assistant' ,
2323 status : 'pending' ,
24- }
24+ } ,
2525 ] ,
2626} ;
2727
@@ -43,16 +43,18 @@ export default function Usage() {
4343 avatar = "https://tdesign.gtimg.com/site/chat-avatar.png"
4444 datetime = "今天16:38"
4545 name = "TDesignAI"
46- message = { message } { ...changedProps } />
46+ role = "user"
47+ { ...message }
48+ { ...changedProps }
49+ />
4750 < ChatMessage
4851 avatar = "https://tdesign.gtimg.com/site/chat-avatar.png"
4952 datetime = "今天16:38"
5053 name = "TDesignAI"
51- message = { {
52- id : '11111' ,
53- role : 'assistant' ,
54- status : 'pending' ,
55- } } { ...changedProps } />
54+ role = "assistant"
55+ status = "pending"
56+ { ...changedProps }
57+ />
5658 </ div > ,
5759 ) ;
5860 } , [ changedProps ] ) ;
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export default function TravelPlannerChat() {
8080 // 创建聊天服务配置
8181 const createChatServiceConfig = ( ) => ( {
8282 // 对话服务地址 - 使用 POST 请求
83- endpoint : `http ://localhost:3000 /sse/agui` ,
83+ endpoint : `https ://1257786608-9i9j1kpa67.ap-guangzhou.tencentscf.com /sse/agui` ,
8484 protocol : 'agui' as const ,
8585 stream : true ,
8686 // 流式对话结束
Original file line number Diff line number Diff line change 5151 },
5252 "dependencies" : {
5353 "@babel/runtime" : " ~7.26.7" ,
54- "tdesign-web-components" : " 1.2.1-beta.4 " ,
54+ "tdesign-web-components" : " 1.2.1" ,
5555 "classnames" : " ~2.5.1" ,
5656 "lodash-es" : " ^4.17.21" ,
5757 "zod" : " ^3.24.2" ,
You can’t perform that action at this time.
0 commit comments