mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 05:39:05 +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.
|
// while a model belonging to that provider may be limited to processing only one specific file type.
|
||||||
export type OcrModelCapabilityRecord = OcrProviderCapabilityRecord
|
export type OcrModelCapabilityRecord = OcrProviderCapabilityRecord
|
||||||
|
|
||||||
export interface OcrModel {
|
export const OcrModelSchema = z.object({
|
||||||
id: string
|
id: z.string(),
|
||||||
name: string
|
name: z.string(),
|
||||||
providerId: string
|
providerId: z.string(),
|
||||||
capabilities: OcrModelCapabilityRecord
|
capabilities: OcrProviderCapabilityRecordSchema
|
||||||
}
|
})
|
||||||
|
|
||||||
|
export type OcrModel = z.infer<typeof OcrModelSchema>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend this type to define provider-specefic config types.
|
* Extend this type to define provider-specefic config types.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user