fix: log page compatible old query (#1141)

This commit is contained in:
Joel 2023-09-10 11:29:25 +08:00 committed by GitHub
parent 5412f4aba5
commit e925b6c572
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ const getFormattedChatList = (messages: ChatMessage[]) => {
messages.forEach((item: ChatMessage) => {
newChatList.push({
id: `question-${item.id}`,
content: item.inputs.query || item.query, // text generation: item.inputs.query; chat: item.query
content: item.inputs.query || item.inputs.default_input || item.query, // text generation: item.inputs.query; chat: item.query
isAnswer: false,
})
@ -413,7 +413,7 @@ const ConversationList: FC<IConversationList> = ({ logs, appDetail, onRefresh })
<tbody className="text-gray-500">
{logs.data.map((log) => {
const endUser = log.from_end_user_session_id
const leftValue = get(log, isChatMode ? 'summary' : 'message.inputs.query')
const leftValue = get(log, isChatMode ? 'summary' : 'message.inputs.query') || (!isChatMode ? (get(log, 'message.query') || get(log, 'message.inputs.default_input')) : '') || ''
const rightValue = get(log, isChatMode ? 'message_count' : 'message.answer')
return <tr
key={log.id}