Chores: fix name typo (#6987)

This commit is contained in:
Vico Chu 2024-08-06 13:33:21 +08:00 committed by GitHub
parent 23ed15d19f
commit 1c043b8426
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 14 deletions

View File

@ -83,7 +83,7 @@ export const useChat = (
const { t } = useTranslation()
const { formatTime } = useTimestamp()
const { notify } = useToastContext()
const connversationId = useRef('')
const conversationId = useRef('')
const hasStopResponded = useRef(false)
const [isResponding, setIsResponding] = useState(false)
const isRespondingRef = useRef(false)
@ -152,7 +152,7 @@ export const useChat = (
}, [stopChat, handleResponding])
const handleRestart = useCallback(() => {
connversationId.current = ''
conversationId.current = ''
taskIdRef.current = ''
handleStop()
const newChatList = config?.opening_statement
@ -248,7 +248,7 @@ export const useChat = (
const bodyParams = {
response_mode: 'streaming',
conversation_id: connversationId.current,
conversation_id: conversationId.current,
...data,
}
if (bodyParams?.files?.length) {
@ -302,7 +302,7 @@ export const useChat = (
}
if (isFirstMessage && newConversationId)
connversationId.current = newConversationId
conversationId.current = newConversationId
taskIdRef.current = taskId
if (messageId)
@ -322,11 +322,11 @@ export const useChat = (
return
if (onConversationComplete)
onConversationComplete(connversationId.current)
onConversationComplete(conversationId.current)
if (connversationId.current && !hasStopResponded.current && onGetConvesationMessages) {
if (conversationId.current && !hasStopResponded.current && onGetConvesationMessages) {
const { data }: any = await onGetConvesationMessages(
connversationId.current,
conversationId.current,
newAbortController => conversationMessagesAbortControllerRef.current = newAbortController,
)
const newResponseItem = data.find((item: any) => item.id === responseItem.id)
@ -361,7 +361,7 @@ export const useChat = (
latency: newResponseItem.provider_response_latency.toFixed(2),
},
// for agent log
conversationId: connversationId.current,
conversationId: conversationId.current,
input: {
inputs: newResponseItem.inputs,
query: newResponseItem.query,
@ -640,7 +640,7 @@ export const useChat = (
return {
chatList,
setChatList,
conversationId: connversationId.current,
conversationId: conversationId.current,
isResponding,
setIsResponding,
handleSend,

View File

@ -35,7 +35,7 @@ export const useChat = (
const { notify } = useToastContext()
const { handleRun } = useWorkflowRun()
const hasStopResponded = useRef(false)
const connversationId = useRef('')
const conversationId = useRef('')
const taskIdRef = useRef('')
const [chatList, setChatList] = useState<ChatItem[]>(prevChatList || [])
const chatListRef = useRef<ChatItem[]>(prevChatList || [])
@ -100,7 +100,7 @@ export const useChat = (
}, [handleResponding, stopChat])
const handleRestart = useCallback(() => {
connversationId.current = ''
conversationId.current = ''
taskIdRef.current = ''
handleStop()
const newChatList = config?.opening_statement
@ -185,7 +185,7 @@ export const useChat = (
handleResponding(true)
const bodyParams = {
conversation_id: connversationId.current,
conversation_id: conversationId.current,
...params,
}
if (bodyParams?.files?.length) {
@ -214,7 +214,7 @@ export const useChat = (
}
if (isFirstMessage && newConversationId)
connversationId.current = newConversationId
conversationId.current = newConversationId
taskIdRef.current = taskId
if (messageId)
@ -403,7 +403,7 @@ export const useChat = (
}, [handleRun, handleResponding, handleUpdateChatList, notify, t, updateCurrentQA, config.suggested_questions_after_answer?.enabled])
return {
conversationId: connversationId.current,
conversationId: conversationId.current,
chatList,
handleSend,
handleStop,