@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
15 lines (11 loc) • 410 B
text/typescript
import { clientDB, initializeDB } from '../../client/db';
import { LobeChatDatabase } from '../../type';
const isServerDBMode = process.env.TEST_SERVER_DB === '1';
export const getTestDB = async () => {
if (isServerDBMode) {
const { getTestDBInstance } = await import('../../core/dbForTest');
return await getTestDBInstance();
}
await initializeDB();
return clientDB as LobeChatDatabase;
};