mirror of
https://github.com/run-llama/chat-ui.git
synced 2026-07-21 03:15:21 -04:00
fix: send request data when reload (#35)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@llamaindex/chat-ui': patch
|
||||
---
|
||||
|
||||
fix: send request data when reload
|
||||
@@ -146,7 +146,7 @@ function ChatMessagesLoading(props: ChatMessagesLoadingProps) {
|
||||
}
|
||||
|
||||
function ChatActions(props: ChatActionsProps) {
|
||||
const { reload, stop } = useChatUI()
|
||||
const { reload, stop, requestData } = useChatUI()
|
||||
const { showReload, showStop } = useChatMessages()
|
||||
if (!showStop && !showReload) return null
|
||||
|
||||
@@ -159,7 +159,11 @@ function ChatActions(props: ChatActionsProps) {
|
||||
</Button>
|
||||
)}
|
||||
{showReload && (
|
||||
<Button variant="outline" size="sm" onClick={reload}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => reload?.({ data: requestData })}
|
||||
>
|
||||
<RefreshCw className="mr-2 h-4 w-4" />
|
||||
Regenerate
|
||||
</Button>
|
||||
|
||||
@@ -11,7 +11,7 @@ export type ChatHandler = {
|
||||
setInput: (input: string) => void
|
||||
isLoading: boolean
|
||||
messages: Message[]
|
||||
reload?: () => void
|
||||
reload?: (chatRequestOptions?: { data?: any }) => void
|
||||
stop?: () => void
|
||||
append: (
|
||||
message: Message,
|
||||
|
||||
Reference in New Issue
Block a user