fix: chat query (#1170)

Co-authored-by: josh <josh@afterima.ge>
This commit is contained in:
Nicklas Scharpff 2025-09-09 00:29:04 +02:00 committed by GitHub
parent d3b3449eb8
commit f2320bf321
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 879 additions and 145 deletions

View file

@ -31,6 +31,7 @@ export function Chat({
isReadonly,
session,
autoResume,
initialLastContext,
}: {
id: string;
initialMessages: ChatMessage[];
@ -39,6 +40,7 @@ export function Chat({
isReadonly: boolean;
session: Session;
autoResume: boolean;
initialLastContext?: LanguageModelUsage;
}) {
const { visibilityType } = useChatVisibility({
chatId: id,
@ -49,7 +51,9 @@ export function Chat({
const { setDataStream } = useDataStream();
const [input, setInput] = useState<string>('');
const [usage, setUsage] = useState<LanguageModelUsage | undefined>(undefined);
const [usage, setUsage] = useState<LanguageModelUsage | undefined>(
initialLastContext,
);
const {
messages,