feat: support upload image

This commit is contained in:
StyleZhang
2023-11-22 11:08:09 +08:00
parent ae70d2fee1
commit 5dc3658e19
37 changed files with 1674 additions and 33 deletions

View File

@ -77,6 +77,7 @@ export type IChatItem = {
isIntroduction?: boolean
useCurrentUserAvatar?: boolean
isOpeningStatement?: boolean
message_files?: VisionFile[]
}
export type ResponseHolder = {}
@ -95,3 +96,41 @@ export type AppInfo = {
copyright?: string
privacy_policy?: string
}
export enum Resolution {
low = 'low',
high = 'high',
}
export enum TransferMethod {
all = 'all',
local_file = 'local_file',
remote_url = 'remote_url',
}
export type VisionSettings = {
enabled: boolean
number_limits: number
detail: Resolution
transfer_methods: TransferMethod[]
image_file_size_limit?: number | string
}
export type ImageFile = {
type: TransferMethod
_id: string
fileId: string
file?: File
progress: number
url: string
base64Url?: string
deleted?: boolean
}
export type VisionFile = {
id?: string
type: string
transfer_method: TransferMethod
url: string
upload_file_id: string
}