Skip to content

Commit e3c8485

Browse files
authored
Merge pull request #1877 from tisnik/lcore-2492-use-optional-data-types-consistently
LCORE-2492: Use optional data types consistently
2 parents d1c79ab + 24211f6 commit e3c8485

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/models/common/agents/turn_accumulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Mutable per-turn state for agent response processing."""
22

33
from dataclasses import dataclass, field
4-
from typing import Final
4+
from typing import Final, Optional
55

66
from pydantic_ai import AgentRunResult
77

@@ -29,7 +29,7 @@ class AgentTurnAccumulator: # pylint: disable=too-many-instance-attributes
2929
vector_store_ids: Final[list[str]]
3030
rag_id_mapping: Final[dict[str, str]]
3131
turn_summary: TurnSummary
32-
run_result: AgentRunResult[str] | None = None
32+
run_result: Optional[AgentRunResult[str]] = None
3333
chunk_id: int = 0
3434
text_parts: list[str] = field(default_factory=list)
3535
tool_round: int = 1

src/pydantic_ai_lightspeed/llamastack/_provider.py

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

33
from __future__ import annotations as _annotations
44

5-
from typing import TYPE_CHECKING
5+
from typing import TYPE_CHECKING, Optional
66

77
import httpx
88
from openai import AsyncOpenAI
@@ -44,17 +44,17 @@ def client(self) -> AsyncOpenAI:
4444
return self._client
4545

4646
@staticmethod
47-
def model_profile(model_name: str) -> ModelProfile | None:
47+
def model_profile(model_name: str) -> Optional[ModelProfile]:
4848
"""Return the model profile for the named model, if available."""
4949
return openai_model_profile(model_name)
5050

5151
def __init__(
5252
self,
5353
*,
54-
base_url: str | None = None,
55-
api_key: str | None = None,
56-
library_client: AsyncLlamaStackAsLibraryClient | None = None,
57-
http_client: httpx.AsyncClient | None = None,
54+
base_url: Optional[str] = None,
55+
api_key: Optional[str] = None,
56+
library_client: Optional[AsyncLlamaStackAsLibraryClient] = None,
57+
http_client: Optional[httpx.AsyncClient] = None,
5858
) -> None:
5959
"""Create a new Llama Stack provider.
6060

0 commit comments

Comments
 (0)