mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-10-14 11:38:14 +00:00
feat(configManager): fix circular import issues
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { Config, ConfigModelProvider, EnvMap, UIConfigSections } from './types';
|
import { Config, ConfigModelProvider, UIConfigSections } from './types';
|
||||||
import ModelRegistry from '../models/registry';
|
|
||||||
import { hashObj } from '../serverUtils';
|
import { hashObj } from '../serverUtils';
|
||||||
|
import { getModelProvidersUIConfigSection } from '../models/providers';
|
||||||
|
|
||||||
class ConfigManager {
|
class ConfigManager {
|
||||||
configPath: string = path.join(
|
configPath: string = path.join(
|
||||||
@@ -19,7 +19,6 @@ class ConfigManager {
|
|||||||
general: [],
|
general: [],
|
||||||
modelProviders: [],
|
modelProviders: [],
|
||||||
};
|
};
|
||||||
modelRegistry = new ModelRegistry();
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.initialize();
|
this.initialize();
|
||||||
@@ -78,7 +77,7 @@ class ConfigManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private initializeFromEnv() {
|
private initializeFromEnv() {
|
||||||
const providerConfigSections = this.modelRegistry.getUIConfigSection();
|
const providerConfigSections = getModelProvidersUIConfigSection();
|
||||||
|
|
||||||
this.uiConfigSections.modelProviders = providerConfigSections;
|
this.uiConfigSections.modelProviders = providerConfigSections;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user