feat: [frontend] support vision (#1518)

Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
zxhlyh
2023-11-13 22:32:39 +08:00
committed by GitHub
parent 41d0a8b295
commit 6b15827246
74 changed files with 3159 additions and 339 deletions

View File

@@ -176,6 +176,10 @@ export type ModelConfig = {
}
}
dataset_configs: DatasetConfigs
file_upload?: {
image: VisionSettings
}
files?: VisionFile[]
}
export const LanguagesSupported = ['zh-Hans', 'en-US'] as const
@@ -269,3 +273,40 @@ export type AppTemplate = {
/** Model */
model_config: ModelConfig
}
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
}
export type VisionFile = {
id?: string
type: string
transfer_method: TransferMethod
url: string
upload_file_id: string
}