Skip to content

Commit 3222a24

Browse files
committed
Add addtional type hints
1 parent e2f1b21 commit 3222a24

File tree

1 file changed

+3
-3
lines changed
  • pydantic_ai_slim/pydantic_ai/durable_exec/restate

1 file changed

+3
-3
lines changed

pydantic_ai_slim/pydantic_ai/durable_exec/restate/_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from contextlib import contextmanager
55
from typing import Any, Never, overload
66
from typing_extensions import Generic
7-
from dataclasses import dataclass
87

98
from pydantic_ai import models
109
from pydantic_ai._run_context import AgentDepsT
@@ -38,6 +37,7 @@ def __init__(self,
3837
# here we collect all the configuration that will be passed to the RestateAgent
3938
# the actual context will be provided at runtime.
4039
self.wrapped = wrapped
40+
self.model = wrapped.model
4141
self.max_attempts = max_attempts
4242

4343
def create_agent(self, context: Context) -> AbstractAgent[AgentDepsT, OutputDataT]:
@@ -70,7 +70,7 @@ async def get_weather(ctx: restate.Context, city: str):
7070
Returns:
7171
A RestateAgent instance that uses the provided context for its operations.
7272
"""
73-
get_context = lambda _unused: context
73+
get_context: Callable[[AgentDepsT], Context] = lambda _unused: context
7474
builder = self
7575
return RestateAgent(builder=builder, get_context=get_context, auto_wrap_tools=True)
7676

@@ -139,7 +139,7 @@ def __init__(
139139

140140
@contextmanager
141141
def _restate_overrides(self, context: Context) -> Iterator[None]:
142-
model = RestateModelWrapper(self._builder.wrapped.model, context, max_attempts=self._builder.max_attempts)
142+
model = RestateModelWrapper(self._builder.model, context, max_attempts=self._builder.max_attempts)
143143

144144
def set_context(toolset: AbstractToolset[AgentDepsT]) -> AbstractToolset[AgentDepsT]:
145145
"""Set the Restate context for the toolset, wrapping tools if needed."""

0 commit comments

Comments
 (0)