File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 44from typing import Any , Optional
55
66import yaml
7- from models .config import Configuration , LLamaStackConfiguration , UserDataCollection
7+ from models .config import (
8+ Configuration ,
9+ LLamaStackConfiguration ,
10+ UserDataCollection ,
11+ ServiceConfiguration ,
12+ )
813
914logger = logging .getLogger (__name__ )
1015
@@ -43,6 +48,14 @@ def configuration(self) -> Configuration:
4348 ), "logic error: configuration is not loaded"
4449 return self ._configuration
4550
51+ @property
52+ def service_configuration (self ) -> ServiceConfiguration :
53+ """Return service configuration."""
54+ assert (
55+ self ._configuration is not None
56+ ), "logic error: configuration is not loaded"
57+ return self ._configuration .service
58+
4659 @property
4760 def llama_stack_configuration (self ) -> LLamaStackConfiguration :
4861 """Return Llama stack configuration."""
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def test_init_from_dict() -> None:
4848 cfg .init_from_dict (config_dict )
4949 assert cfg .configuration is not None
5050 assert cfg .llama_stack_configuration is not None
51+ assert cfg .service_configuration is not None
5152
5253
5354def test_load_proper_configuration (tmpdir ) -> None :
@@ -76,3 +77,4 @@ def test_load_proper_configuration(tmpdir) -> None:
7677 cfg .load_configuration (cfg_filename )
7778 assert cfg .configuration is not None
7879 assert cfg .llama_stack_configuration is not None
80+ assert cfg .service_configuration is not None
You can’t perform that action at this time.
0 commit comments