Skip to content

Commit 1ffcaa8

Browse files
committed
use str | None instead of optional
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent 958797a commit 1ffcaa8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

docs/config.puml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class "UnifiedInferenceProvider" as src.models.config.UnifiedInferenceProvider {
303303
allowed_models : Optional[list[str]]
304304
api_key_env : Optional[str]
305305
extra : dict[str, object]
306-
id : Optional[str]
306+
id : str | None
307307
type : Literal['openai', 'ollama', 'vllm', 'sentence_transformers', 'azure', 'vertexai', 'watsonx', 'vllm_rhaiis', 'vllm_rhel_ai']
308308
}
309309
class "UnifiedLlamaStackConfig" as src.models.config.UnifiedLlamaStackConfig {

src/models/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ class UnifiedInferenceProvider(ConfigurationBase):
698698
"Llama Stack provider_type by the synthesizer.",
699699
)
700700

701-
id: Optional[str] = Field(
701+
id: str | None = Field(
702702
None,
703703
title="Provider ID",
704704
description="Optional identifier emitted as the Llama Stack provider_id. "
@@ -730,7 +730,7 @@ class UnifiedInferenceProvider(ConfigurationBase):
730730

731731
@field_validator("id")
732732
@classmethod
733-
def validate_id(cls, value: Optional[str]) -> Optional[str]:
733+
def validate_id(cls, value: str | None) -> str | None:
734734
"""Strip and validate an optional high-level provider id.
735735
736736
Parameters:

0 commit comments

Comments
 (0)