MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / load_json_config

Function load_json_config

api/config.py:105–126  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

103
104# Load JSON configuration file
105def load_json_config(filename):
106 try:
107 # If environment variable is set, use the directory specified by it
108 if CONFIG_DIR:
109 config_path = Path(CONFIG_DIR) / filename
110 else:
111 # Otherwise use default directory
112 config_path = Path(__file__).parent / "config" / filename
113
114 logger.info(f"Loading configuration from {config_path}")
115
116 if not config_path.exists():
117 logger.warning(f"Configuration file {config_path} does not exist")
118 return {}
119
120 with open(config_path, 'r', encoding='utf-8') as f:
121 config = json.load(f)
122 config = replace_env_placeholders(config)
123 return config
124 except Exception as e:
125 logger.error(f"Error loading configuration file {filename}: {str(e)}")
126 return {}
127
128# Load generator model configuration
129def load_generator_config():

Callers 4

load_generator_configFunction · 0.85
load_embedder_configFunction · 0.85
load_repo_configFunction · 0.85
load_lang_configFunction · 0.85

Calls 1

replace_env_placeholdersFunction · 0.85

Tested by

no test coverage detected