mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 10:16:40 +08:00
chat
This commit is contained in:
parent
513d075ebc
commit
672b8f14f2
@ -8,6 +8,7 @@ import {
|
|||||||
import { useStore } from '../../store'
|
import { useStore } from '../../store'
|
||||||
import UserInput from './user-input'
|
import UserInput from './user-input'
|
||||||
import Chat from '@/app/components/base/chat/chat'
|
import Chat from '@/app/components/base/chat/chat'
|
||||||
|
import type { ChatItem } from '@/app/components/base/chat/types'
|
||||||
import { fetchConvesationMessages } from '@/service/debug'
|
import { fetchConvesationMessages } from '@/service/debug'
|
||||||
import { useStore as useAppStore } from '@/app/components/app/store'
|
import { useStore as useAppStore } from '@/app/components/app/store'
|
||||||
import Loading from '@/app/components/base/loading'
|
import Loading from '@/app/components/base/loading'
|
||||||
@ -19,7 +20,7 @@ const ChatRecord = () => {
|
|||||||
const currentConversationID = useStore(s => s.currentConversationID)
|
const currentConversationID = useStore(s => s.currentConversationID)
|
||||||
|
|
||||||
const chatMessageList = useMemo(() => {
|
const chatMessageList = useMemo(() => {
|
||||||
const res: any = []
|
const res: ChatItem[] = []
|
||||||
if (chatList.length) {
|
if (chatList.length) {
|
||||||
chatList.forEach((item: any) => {
|
chatList.forEach((item: any) => {
|
||||||
res.push({
|
res.push({
|
||||||
@ -35,10 +36,11 @@ const ChatRecord = () => {
|
|||||||
isAnswer: true,
|
isAnswer: true,
|
||||||
citation: item.retriever_resources,
|
citation: item.retriever_resources,
|
||||||
message_files: item.message_files?.filter((file: any) => file.belongs_to === 'assistant') || [],
|
message_files: item.message_files?.filter((file: any) => file.belongs_to === 'assistant') || [],
|
||||||
|
workflow_run_id: item.workflow_run_id,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return res as any
|
return res
|
||||||
}, [chatList])
|
}, [chatList])
|
||||||
|
|
||||||
const handleFetchConvesationMessages = useCallback(async () => {
|
const handleFetchConvesationMessages = useCallback(async () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user