fix: use MAIN_VITE_MINERU_API_KEY and ocr only use in macos
This commit is contained in:
+4
-4
@@ -61,13 +61,13 @@
|
||||
"@libsql/client": "0.14.0",
|
||||
"@libsql/win32-x64-msvc": "^0.4.7",
|
||||
"@strongtz/win32-arm64-msvc": "^0.4.7",
|
||||
"canvas": "3.1.0",
|
||||
"jsdom": "26.1.0",
|
||||
"os-proxy-config": "^1.1.2",
|
||||
"selection-hook": "^0.9.23",
|
||||
"turndown": "7.2.0",
|
||||
"canvas": "3.1.0",
|
||||
"pdf-to-img": "^4.4.0",
|
||||
"pdfjs-dist": "4.2.67"
|
||||
"pdfjs-dist": "4.2.67",
|
||||
"selection-hook": "^0.9.23",
|
||||
"turndown": "7.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@agentic/exa": "^7.3.3",
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class MineruPreprocessProvider extends BasePreprocessProvider {
|
||||
constructor(provider: PreprocessProvider, userId?: string) {
|
||||
super(provider, userId)
|
||||
// todo:免费期结束后删除
|
||||
this.provider.apiKey = this.provider.apiKey || import.meta.env.RENDERER_VITE_MINERU_API_KEY
|
||||
this.provider.apiKey = this.provider.apiKey || import.meta.env.MAIN_VITE_MINERU_API_KEY
|
||||
}
|
||||
|
||||
public async parseFile(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { InfoCircleOutlined, SettingOutlined, WarningOutlined } from '@ant-design/icons'
|
||||
import AiProvider from '@renderer/aiCore'
|
||||
import { TopView } from '@renderer/components/TopView'
|
||||
import { DEFAULT_KNOWLEDGE_DOCUMENT_COUNT } from '@renderer/config/constant'
|
||||
import { DEFAULT_KNOWLEDGE_DOCUMENT_COUNT, isMac } from '@renderer/config/constant'
|
||||
import { getEmbeddingMaxContext } from '@renderer/config/embedings'
|
||||
import { isEmbeddingModel, isRerankModel } from '@renderer/config/models'
|
||||
import { NOT_SUPPORTED_REANK_PROVIDERS } from '@renderer/config/providers'
|
||||
@@ -108,7 +108,8 @@ const PopupContainer: React.FC<Props> = ({ title, resolve }) => {
|
||||
title: t('settings.tool.ocr.provider'),
|
||||
options: ocrProviders.filter((p) => p.apiKey !== '').map((p) => ({ value: p.id, label: p.name }))
|
||||
}
|
||||
return [preprocessOptions, ocrOptions]
|
||||
|
||||
return isMac ? [preprocessOptions, ocrOptions] : [preprocessOptions]
|
||||
}, [ocrProviders, preprocessProviders])
|
||||
|
||||
const onOk = async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { InfoCircleOutlined, SettingOutlined, WarningOutlined } from '@ant-design/icons'
|
||||
import { TopView } from '@renderer/components/TopView'
|
||||
import { DEFAULT_KNOWLEDGE_DOCUMENT_COUNT } from '@renderer/config/constant'
|
||||
import { DEFAULT_KNOWLEDGE_DOCUMENT_COUNT, isMac } from '@renderer/config/constant'
|
||||
import { getEmbeddingMaxContext } from '@renderer/config/embedings'
|
||||
import { isEmbeddingModel, isRerankModel } from '@renderer/config/models'
|
||||
import { useKnowledge } from '@renderer/hooks/useKnowledge'
|
||||
@@ -84,7 +84,10 @@ const PopupContainer: React.FC<Props> = ({ base: _base, resolve }) => {
|
||||
options: ocrProviders.filter((p) => p.apiKey !== '').map((p) => ({ value: p.id, label: p.name }))
|
||||
}
|
||||
|
||||
const preprocessOrOcrSelectOptions = [preprocessOptions, ocrOptions].filter((group) => group.options.length > 0)
|
||||
const preprocessOrOcrSelectOptions = [
|
||||
...(preprocessOptions.options.length > 0 ? [preprocessOptions] : []),
|
||||
...(isMac && ocrOptions.options.length > 0 ? [ocrOptions] : [])
|
||||
]
|
||||
|
||||
const onOk = async () => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user