@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.
20 lines (14 loc) • 555 B
text/typescript
import urlJoin from 'url-join';
import { DEFAULT_LANG, isLocaleNotSupport } from '@/const/locale';
import { appEnv } from '@/envs/app';
import { Locales, normalizeLocale } from '@/locales/resources';
export class PluginStore {
private readonly baseUrl: string;
constructor(baseUrl?: string) {
this.baseUrl = baseUrl || appEnv.PLUGINS_INDEX_URL;
}
getPluginIndexUrl = (lang: Locales = DEFAULT_LANG) => {
if (isLocaleNotSupport(lang)) return this.baseUrl;
return urlJoin(this.baseUrl, `index.${normalizeLocale(lang)}.json`);
};
}