fixed review comments

This commit is contained in:
Arjun 2026-02-26 21:03:58 +05:30
parent 5d78d66b00
commit a0a7933a7c
8 changed files with 53 additions and 76 deletions

View file

@ -28,15 +28,6 @@ export const AssistantContentPart = z.union([
ToolCallPart,
]);
// Metadata about an attached file or image
export const Attachment = z.object({
type: z.enum(["file", "image"]), // extensible — could add "url", "audio" later
path: z.string(), // absolute file path
filename: z.string(), // display name ("photo.png")
mediaType: z.string(), // MIME type ("image/png", "text/plain")
size: z.number().optional(), // bytes
});
// A piece of user-typed text within a content array
export const UserTextPart = z.object({
type: z.literal("text"),
@ -46,7 +37,10 @@ export const UserTextPart = z.object({
// An attachment within a content array
export const UserAttachmentPart = z.object({
type: z.literal("attachment"),
attachment: Attachment,
path: z.string(), // absolute file path
filename: z.string(), // display name ("photo.png")
mimeType: z.string(), // MIME type ("image/png", "text/plain")
size: z.number().optional(), // bytes
});
// Any single part of a user message (text or attachment)