chore: thinking before response (#1270)

This commit is contained in:
josh 2025-10-09 20:03:07 +01:00 committed by GitHub
parent 1c13682721
commit 896d368515
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 31 deletions

View file

@ -1,5 +1,6 @@
import type { UseChatHelpers } from "@ai-sdk/react";
import equal from "fast-deep-equal";
import { AnimatePresence } from "framer-motion";
import { ArrowDownIcon } from "lucide-react";
import { memo, useEffect } from "react";
import { useMessages } from "@/hooks/use-messages";
@ -90,10 +91,9 @@ function PureMessages({
/>
))}
{status === "submitted" &&
messages.length > 0 &&
messages.at(-1)?.role === "user" &&
selectedModelId !== "chat-model-reasoning" && <ThinkingMessage />}
<AnimatePresence mode="wait">
{status === "submitted" && <ThinkingMessage key="thinking" />}
</AnimatePresence>
<div
className="min-h-[24px] min-w-[24px] shrink-0"