refactor: replace message.content with message.parts (#868)

This commit is contained in:
Jeremy 2025-03-16 18:42:29 -07:00 committed by GitHub
parent 553a3d825a
commit 47a630fd53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 1311 additions and 311 deletions

View file

@ -1,11 +1,6 @@
'use client';
import type {
Attachment,
ChatRequestOptions,
CreateMessage,
Message,
} from 'ai';
import type { Attachment, Message } from 'ai';
import cx from 'classnames';
import type React from 'react';
import {
@ -21,8 +16,6 @@ import {
import { toast } from 'sonner';
import { useLocalStorage, useWindowSize } from 'usehooks-ts';
import { sanitizeUIMessages } from '@/lib/utils';
import { ArrowUpIcon, PaperclipIcon, StopIcon } from './icons';
import { PreviewAttachment } from './preview-attachment';
import { Button } from './ui/button';
@ -324,7 +317,7 @@ function PureStopButton({
onClick={(event) => {
event.preventDefault();
stop();
setMessages((messages) => sanitizeUIMessages(messages));
setMessages((messages) => messages);
}}
>
<StopIcon size={14} />