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
|
|
@ -1,27 +1,25 @@
|
|||
import { z } from 'zod';
|
||||
|
||||
const textPartSchema = z.object({
|
||||
text: z.string().min(1).max(2000),
|
||||
type: z.enum(['text']),
|
||||
text: z.string().min(1).max(2000),
|
||||
});
|
||||
|
||||
const filePartSchema = z.object({
|
||||
type: z.enum(['file']),
|
||||
mediaType: z.enum(['image/jpeg', 'image/png']),
|
||||
name: z.string().min(1).max(100),
|
||||
url: z.string().url(),
|
||||
});
|
||||
|
||||
const partSchema = z.union([textPartSchema, filePartSchema]);
|
||||
|
||||
export const postRequestBodySchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
message: z.object({
|
||||
id: z.string().uuid(),
|
||||
createdAt: z.coerce.date(),
|
||||
role: z.enum(['user']),
|
||||
content: z.string().min(1).max(2000),
|
||||
parts: z.array(textPartSchema),
|
||||
experimental_attachments: z
|
||||
.array(
|
||||
z.object({
|
||||
url: z.string().url(),
|
||||
name: z.string().min(1).max(2000),
|
||||
contentType: z.enum(['image/png', 'image/jpg', 'image/jpeg']),
|
||||
}),
|
||||
)
|
||||
.optional(),
|
||||
parts: z.array(partSchema),
|
||||
}),
|
||||
selectedChatModel: z.enum(['chat-model', 'chat-model-reasoning']),
|
||||
selectedVisibilityType: z.enum(['public', 'private']),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue