Skip to content

Commit 4cb2e83

Browse files
authored
Merge pull request #2135 from tisnik/lcore-2810
LCORE-2810: Consistent Optional data type in LCore sources
2 parents 21866ff + 19b8688 commit 4cb2e83

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

scripts/latest-tag.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import os
44
import subprocess
5+
from typing import Optional
56

67

78
def version_split(value: str) -> tuple[int, ...]:
@@ -19,7 +20,7 @@ def is_prerelease(tag: str) -> bool:
1920
return any(n in tag for n in omit)
2021

2122

22-
def get_latest_stable() -> str | None:
23+
def get_latest_stable() -> Optional[str]:
2324
"""Return the latest stable tag."""
2425
stdout = subprocess.check_output(["git", "tag"], text=True)
2526
tags = [tag for tag in stdout.splitlines() if not is_prerelease(tag)]

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: str | None = Field(
701+
id: Optional[str] = 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: str | None) -> str | None:
733+
def validate_id(cls, value: Optional[str]) -> Optional[str]:
734734
"""Strip and validate an optional high-level provider id.
735735
736736
Parameters:

src/pydantic_ai_lightspeed/llamastack/_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,9 @@ def from_llama_stack_client(
360360
model_name: str,
361361
client: AsyncLlamaStackClient | AsyncLlamaStackAsLibraryClient,
362362
*,
363-
responses_params: ResponsesApiParams | None = None,
364-
model_settings: ModelSettings | None = None,
365-
profile: ModelProfileSpec | None = None,
363+
responses_params: Optional[ResponsesApiParams] = None,
364+
model_settings: Optional[ModelSettings] = None,
365+
profile: Optional[ModelProfileSpec] = None,
366366
) -> LlamaStackResponsesModel:
367367
"""Create a ``LlamaStackResponsesModel`` from a Llama Stack client.
368368

0 commit comments

Comments
 (0)