mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
feat: file attachment input
This commit is contained in:
+15
-1
@@ -40,4 +40,18 @@ export const ScheduleModel = z.object({
|
||||
pattern: z.string().min(1, 'Schedule pattern is required'),
|
||||
maxCalls: z.number().nullable().optional(),
|
||||
command: z.string().min(1, 'Schedule command is required'),
|
||||
})
|
||||
})
|
||||
|
||||
export const ImageAttachmentModel = z.object({
|
||||
type: z.literal('image'),
|
||||
base64: z.string().min(1, 'Image base64 is required'),
|
||||
metadata: z.record(z.string(), z.any()).optional(),
|
||||
})
|
||||
|
||||
export const FileAttachmentModel = z.object({
|
||||
type: z.literal('file'),
|
||||
path: z.string().min(1, 'File path is required'),
|
||||
metadata: z.record(z.string(), z.any()).optional(),
|
||||
})
|
||||
|
||||
export const AttachmentModel = z.union([ImageAttachmentModel, FileAttachmentModel])
|
||||
Reference in New Issue
Block a user