We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2004d97 + af75acc commit 701065bCopy full SHA for 701065b
1 file changed
src/configuration.py
@@ -3,6 +3,10 @@
3
import logging
4
from typing import Any, Optional
5
6
+# We want to support environment variable replacement in the configuration
7
+# similarly to how it is done in llama-stack, so we use their function directly
8
+from llama_stack.core.stack import replace_env_vars
9
+
10
import yaml
11
from models.config import (
12
Configuration,
@@ -16,6 +20,7 @@
16
20
DatabaseConfiguration,
17
21
)
18
22
23
19
24
logger = logging.getLogger(__name__)
25
26
@@ -38,6 +43,7 @@ def load_configuration(self, filename: str) -> None:
38
43
"""Load configuration from YAML file."""
39
44
with open(filename, encoding="utf-8") as fin:
40
45
config_dict = yaml.safe_load(fin)
46
+ config_dict = replace_env_vars(config_dict)
41
47
logger.info("Loaded configuration: %s", config_dict)
42
48
self.init_from_dict(config_dict)
49
0 commit comments