@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
40 lines (37 loc) • 770 B
text/typescript
import { z } from 'zod';
export const DB_FileSchema = z.object({
/**
* create Time
*/
createdAt: z.number().optional(),
/**
* file data array buffer
*/
data: z.instanceof(ArrayBuffer).optional(),
/**
* file type
* @example 'image/png'
*/
fileType: z.string(),
metadata: z.any().optional(),
/**
* file name
* @example 'test.png'
*/
name: z.string(),
/**
* the mode database save the file
* local mean save the raw file into data
* url mean upload the file to a cdn and then save the url
*/
saveMode: z.enum(['local', 'url']),
/**
* file size
*/
size: z.number(),
/**
* file url if saveMode is url
*/
url: z.string().optional(),
});
export type DB_File = z.infer<typeof DB_FileSchema>;