chore: update to ai sdk v5 beta (#1074)
This commit is contained in:
parent
7d8e71383f
commit
4c281fe09d
54 changed files with 1372 additions and 1060 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue