mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
5947f04bd3
Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
806 B
Python
27 lines
806 B
Python
"""Configuration dependency injection for basic-memory.
|
|
|
|
This module provides configuration-related dependencies.
|
|
Note: Long-term goal is to minimize direct ConfigManager access
|
|
and inject config from composition roots instead.
|
|
"""
|
|
|
|
from typing import Annotated
|
|
|
|
from fastapi import Depends
|
|
|
|
from basic_memory.config import BasicMemoryConfig, ConfigManager
|
|
|
|
|
|
def get_app_config() -> BasicMemoryConfig: # pragma: no cover
|
|
"""Get the application configuration.
|
|
|
|
Note: This is a transitional dependency. The goal is for composition roots
|
|
to read ConfigManager and inject config explicitly. During migration,
|
|
this provides the same behavior as before.
|
|
"""
|
|
app_config = ConfigManager().config
|
|
return app_config
|
|
|
|
|
|
AppConfigDep = Annotated[BasicMemoryConfig, Depends(get_app_config)]
|