Skip to content

Commit f6564aa

Browse files
authored
Merge pull request #362 from tisnik/inference-configuration-is-not-optional
Inference configuration is not optional
2 parents 8cc0ac7 + 8b522b9 commit f6564aa

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

docs/config.png

-17.4 KB
Loading

docs/config.puml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class "AuthenticationConfiguration" as src.models.config.AuthenticationConfigura
1212
class "Configuration" as src.models.config.Configuration {
1313
authentication : Optional[AuthenticationConfiguration]
1414
customization : Optional[Customization]
15-
inference : Optional[InferenceConfiguration]
15+
inference
1616
llama_stack
1717
mcp_servers : list[ModelContextProtocolServer]
1818
name : str
@@ -86,6 +86,7 @@ class "UserDataCollection" as src.models.config.UserDataCollection {
8686
check_storage_location_is_set_when_needed() -> Self
8787
}
8888
src.models.config.DataCollectorConfiguration --* src.models.config.UserDataCollection : data_collector
89+
src.models.config.InferenceConfiguration --* src.models.config.Configuration : inference
8990
src.models.config.JwtConfiguration --* src.models.config.JwkConfiguration : jwt_configuration
9091
src.models.config.LlamaStackConfiguration --* src.models.config.Configuration : llama_stack
9192
src.models.config.ServiceConfiguration --* src.models.config.Configuration : service

src/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def customization(self) -> Optional[Customization]:
106106
return self._configuration.customization
107107

108108
@property
109-
def inference(self) -> Optional[InferenceConfiguration]:
109+
def inference(self) -> InferenceConfiguration:
110110
"""Return inference configuration."""
111111
assert (
112112
self._configuration is not None

src/models/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class Configuration(BaseModel):
249249
AuthenticationConfiguration()
250250
)
251251
customization: Optional[Customization] = None
252-
inference: Optional[InferenceConfiguration] = InferenceConfiguration()
252+
inference: InferenceConfiguration = InferenceConfiguration()
253253

254254
def dump(self, filename: str = "configuration.json") -> None:
255255
"""Dump actual configuration into JSON file."""

tests/unit/models/test_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ def test_dump_configuration_with_one_mcp_server(tmp_path) -> None:
577577
),
578578
mcp_servers=mcp_servers,
579579
customization=None,
580-
inference=None,
580+
inference=InferenceConfiguration(),
581581
)
582582
dump_file = tmp_path / "test.json"
583583
cfg.dump(dump_file)
@@ -628,7 +628,7 @@ def test_dump_configuration_with_more_mcp_servers(tmp_path) -> None:
628628
),
629629
mcp_servers=mcp_servers,
630630
customization=None,
631-
inference=None,
631+
inference=InferenceConfiguration(),
632632
)
633633
dump_file = tmp_path / "test.json"
634634
cfg.dump(dump_file)

0 commit comments

Comments
 (0)