chore: update to ai sdk v5 beta (#1074)

This commit is contained in:
Jeremy 2025-07-03 02:26:34 -07:00 committed by GitHub
parent 7d8e71383f
commit 4c281fe09d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 1372 additions and 1060 deletions

View file

@ -5,16 +5,17 @@ import { Button } from './ui/button';
import { memo } from 'react';
import type { UseChatHelpers } from '@ai-sdk/react';
import type { VisibilityType } from './visibility-selector';
import type { ChatMessage } from '@/lib/types';
interface SuggestedActionsProps {
chatId: string;
append: UseChatHelpers['append'];
sendMessage: UseChatHelpers<ChatMessage>['sendMessage'];
selectedVisibilityType: VisibilityType;
}
function PureSuggestedActions({
chatId,
append,
sendMessage,
selectedVisibilityType,
}: SuggestedActionsProps) {
const suggestedActions = [
@ -59,9 +60,9 @@ function PureSuggestedActions({
onClick={async () => {
window.history.replaceState({}, '', `/chat/${chatId}`);
append({
sendMessage({
role: 'user',
content: suggestedAction.action,
parts: [{ type: 'text', text: suggestedAction.action }],
});
}}
className="text-left border rounded-xl px-4 py-3.5 text-sm flex-1 gap-1 sm:flex-col w-full h-auto justify-start items-start"