mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-25 03:10:08 +08:00
refactor(types): convert OcrModel interface to zod schema
Use zod schema for better type safety and validation capabilities
This commit is contained in:
parent
35280b4b8c
commit
2a8f819bee
@ -42,12 +42,14 @@ export type OcrProviderCapabilityRecord = z.infer<typeof OcrProviderCapabilityRe
|
||||
// while a model belonging to that provider may be limited to processing only one specific file type.
|
||||
export type OcrModelCapabilityRecord = OcrProviderCapabilityRecord
|
||||
|
||||
export interface OcrModel {
|
||||
id: string
|
||||
name: string
|
||||
providerId: string
|
||||
capabilities: OcrModelCapabilityRecord
|
||||
}
|
||||
export const OcrModelSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
providerId: z.string(),
|
||||
capabilities: OcrProviderCapabilityRecordSchema
|
||||
})
|
||||
|
||||
export type OcrModel = z.infer<typeof OcrModelSchema>
|
||||
|
||||
/**
|
||||
* Extend this type to define provider-specefic config types.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user