Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat/fix: add regenerate button on failed message responses (#7844)

linuxid10t7070f79aa139
diff --git a/web-app/src/routes/threads/$threadId.tsx b/web-app/src/routes/threads/$threadId.tsx
index 886935d36..f114cbce6 100644
--- a/web-app/src/routes/threads/$threadId.tsx
+++ b/web-app/src/routes/threads/$threadId.tsx
@@ -46,7 +46,7 @@ import { PromptProgress } from '@/components/PromptProgress'
import { useToolAvailable } from '@/hooks/useToolAvailable'
import { OUT_OF_CONTEXT_SIZE } from '@/utils/error'
import { Button } from '@/components/ui/button'
-import { IconAlertCircle } from '@tabler/icons-react'
+import { IconAlertCircle, IconRefresh } from '@tabler/icons-react'
import { useToolApproval } from '@/hooks/useToolApproval'
import DropdownModelProvider from '@/containers/DropdownModelProvider'
import { ExtensionTypeEnum, VectorDBExtension } from '@janhq/core'
@@ -1037,7 +1037,17 @@ function ThreadDetail() {
<IconAlertCircle className="size-4 mr-2" />
Increase Context Size
</Button>
- ) : null}
+ ) : (
+ <Button
+ variant="outline"
+ size="sm"
+ className="mt-3"
+ onClick={() => handleRegenerate()}
+ >
+ <IconRefresh className="size-4 mr-2" />
+ Regenerate
+ </Button>
+ )}
</div>
</div>
</div>