Skip to content

Commit 56d6955

Browse files
authored
chore: cocoindex.init() loads settings from env by default (#526)
1 parent 915b85d commit 56d6955

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

python/cocoindex/lib.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212
from .convert import dump_engine_object
1313

1414

15-
def init(settings: setting.Settings):
16-
"""Initialize the cocoindex library."""
15+
def init(settings: setting.Settings | None):
16+
"""
17+
Initialize the cocoindex library.
18+
19+
If the settings are not provided, they are loaded from the environment variables.
20+
"""
21+
settings = settings or setting.Settings.from_env()
1722
_engine.init(dump_engine_object(settings))
1823
setting.set_app_namespace(settings.app_namespace)
1924

0 commit comments

Comments
 (0)