feat(web): chart content support files

This commit is contained in:
zhaoying
2026-03-18 20:55:31 +08:00
parent 04b2205769
commit be46ed8865
9 changed files with 101 additions and 27 deletions

View File

@@ -1,3 +1,9 @@
/*
* @Author: ZhaoYing
* @Date: 2026-03-13 17:27:52
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-18 20:54:35
*/
import { type FC, useState, useRef, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { App } from 'antd'
@@ -116,7 +122,9 @@ const TestChat: FC<TestChatProps> = ({
role: 'user',
content: message,
created_at: Date.now(),
files
meta_data: {
files
},
}])
}
@@ -136,7 +144,7 @@ const TestChat: FC<TestChatProps> = ({
const lastMsg = newList[newList.length - 1]
if (lastMsg.role === 'assistant') {
lastMsg.content += content;
lastMsg.audioUrl = audio_url
lastMsg.meta_data = {audio_url}
}
return newList
})
@@ -428,7 +436,7 @@ const TestChat: FC<TestChatProps> = ({
status,
error,
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content,
audioUrl: audio_url
meta_data: { audio_url: audio_url }
}
}
return newList