mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
feat(ocr): 添加OCR服务基础功能
实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型
This commit is contained in:
parent
01ad89eb54
commit
01360e3a4b
14
src/renderer/src/services/OcrService.ts
Normal file
14
src/renderer/src/services/OcrService.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { OcrProvider, OcrResult, SupportedOcrFile } from '@renderer/types/ocr'
|
||||
|
||||
// const logger = loggerService.withContext('main:OcrService')
|
||||
|
||||
/**
|
||||
* ocr a file
|
||||
* @param file any supported file
|
||||
* @param provider ocr provider
|
||||
* @returns ocr result
|
||||
* @throws {Error}
|
||||
*/
|
||||
export const ocr = async (file: SupportedOcrFile, provider: OcrProvider): Promise<OcrResult> => {
|
||||
return window.api.ocr.ocr(file, provider)
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user