mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-04-28 11:36:25 +00:00
* Remove all global settings state * chore: remove autogenerated class * chore: cleanup * chore: merge conflicts
20 lines
537 B
Python
20 lines
537 B
Python
from injector import Injector
|
|
|
|
from private_gpt.settings.settings import Settings, unsafe_typed_settings
|
|
|
|
|
|
def create_application_injector() -> Injector:
|
|
_injector = Injector(auto_bind=True)
|
|
_injector.binder.bind(Settings, to=unsafe_typed_settings)
|
|
return _injector
|
|
|
|
|
|
"""
|
|
Global injector for the application.
|
|
|
|
Avoid using this reference, it will make your code harder to test.
|
|
|
|
Instead, use the `request.state.injector` reference, which is bound to every request
|
|
"""
|
|
global_injector: Injector = create_application_injector()
|