mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-30 23:28:52 +01:00
15 lines
433 B
TypeScript
15 lines
433 B
TypeScript
|
|
import type { TCustomConfig } from '../src/config';
|
||
|
|
import { OCRStrategy } from '../src/config';
|
||
|
|
|
||
|
|
export function loadOCRConfig(config: TCustomConfig['ocr']): TCustomConfig['ocr'] {
|
||
|
|
const baseURL = config?.baseURL ?? '';
|
||
|
|
const apiKey = config?.apiKey ?? '';
|
||
|
|
const mistralModel = config?.mistralModel ?? '';
|
||
|
|
return {
|
||
|
|
apiKey,
|
||
|
|
baseURL,
|
||
|
|
mistralModel,
|
||
|
|
strategy: config?.strategy ?? OCRStrategy.MISTRAL_OCR,
|
||
|
|
};
|
||
|
|
}
|