fix: Generate A Response button does not show context size error dialog (#6029)
* fix: Generate A Response button does not show context size error dialog * chore: remove as a child button params
This commit is contained in:
parent
29ad6691d8
commit
641df474fd
@ -36,7 +36,10 @@ export default function OutOfContextPromiseModal() {
|
||||
|
||||
return (
|
||||
<Dialog open={isModalOpen} onOpenChange={handleDialogOpen}>
|
||||
<DialogContent>
|
||||
<DialogContent
|
||||
showCloseButton={false}
|
||||
onInteractOutside={(e) => e.preventDefault()}
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle>{t('model-errors:title')}</DialogTitle>
|
||||
</DialogHeader>
|
||||
@ -57,7 +60,7 @@ export default function OutOfContextPromiseModal() {
|
||||
{t('model-errors:truncateInput')}
|
||||
</Button>
|
||||
<Button
|
||||
asChild
|
||||
autoFocus
|
||||
onClick={() => {
|
||||
handleContextLength()
|
||||
}}
|
||||
|
||||
@ -365,8 +365,7 @@ export const useChat = () => {
|
||||
if (
|
||||
typeof errorMessage === 'string' &&
|
||||
errorMessage.includes(OUT_OF_CONTEXT_SIZE) &&
|
||||
selectedModel &&
|
||||
troubleshooting
|
||||
selectedModel
|
||||
) {
|
||||
const method = await showIncreaseContextSizeModal()
|
||||
if (method === 'ctx_len') {
|
||||
|
||||
@ -4,8 +4,7 @@ import { UIEventHandler } from 'react'
|
||||
import debounce from 'lodash.debounce'
|
||||
import cloneDeep from 'lodash.clonedeep'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { ArrowDown } from 'lucide-react'
|
||||
import { Play } from 'lucide-react'
|
||||
import { ArrowDown, Play } from 'lucide-react'
|
||||
|
||||
import HeaderPage from '@/containers/HeaderPage'
|
||||
import { useThreads } from '@/hooks/useThreads'
|
||||
@ -328,7 +327,7 @@ function ThreadDetail() {
|
||||
>
|
||||
{showScrollToBottomBtn && (
|
||||
<div
|
||||
className="bg-main-view-fg/10 px-4 border border-main-view-fg/5 flex items-center justify-center rounded-xl gap-x-2 cursor-pointer pointer-events-auto"
|
||||
className="bg-main-view-fg/10 px-2 border border-main-view-fg/5 flex items-center justify-center rounded-xl gap-x-2 cursor-pointer pointer-events-auto"
|
||||
onClick={() => {
|
||||
scrollToBottom(true)
|
||||
setIsUserScrolling(false)
|
||||
@ -340,7 +339,7 @@ function ThreadDetail() {
|
||||
)}
|
||||
{showGenerateAIResponseBtn && (
|
||||
<div
|
||||
className="bg-main-view-fg/10 px-4 border border-main-view-fg/5 flex items-center justify-center rounded-xl gap-x-2 cursor-pointer pointer-events-auto"
|
||||
className="mx-2 bg-main-view-fg/10 px-2 border border-main-view-fg/5 flex items-center justify-center rounded-xl gap-x-2 cursor-pointer pointer-events-auto"
|
||||
onClick={generateAIResponse}
|
||||
>
|
||||
<p className="text-xs">{t('common:generateAiResponse')}</p>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user