Skip to content

Commit 6f2d52f

Browse files
committed
fix: appease the type checker
1 parent cc53c21 commit 6f2d52f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

pydantic_ai_slim/pydantic_ai/durable_exec/hatchet/_agent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from typing_extensions import Never
1212

1313
from pydantic_ai import _utils, messages as _messages, models, usage as _usage
14-
from pydantic_ai.agent import AbstractAgent, AgentRun, AgentRunResult, EventStreamHandler, RunOutputDataT, WrapperAgent
14+
from pydantic_ai.agent import AbstractAgent, AgentRun, AgentRunResult, EventStreamHandler, WrapperAgent
15+
from pydantic_ai.agent.abstract import Instructions, RunOutputDataT
1516
from pydantic_ai.exceptions import UserError
1617
from pydantic_ai.messages import AgentStreamEvent
1718
from pydantic_ai.models import Model
@@ -652,6 +653,7 @@ def override(
652653
model: models.Model | models.KnownModelName | str | _utils.Unset = _utils.UNSET,
653654
toolsets: Sequence[AbstractToolset[AgentDepsT]] | _utils.Unset = _utils.UNSET,
654655
tools: Sequence[Tool[AgentDepsT] | ToolFuncEither[AgentDepsT, ...]] | _utils.Unset = _utils.UNSET,
656+
instructions: Instructions[AgentDepsT] | _utils.Unset = _utils.UNSET,
655657
) -> Iterator[None]:
656658
"""Context manager to temporarily override agent dependencies, model, toolsets, or tools.
657659
@@ -663,6 +665,7 @@ def override(
663665
model: The model to use instead of the model passed to the agent run.
664666
toolsets: The toolsets to use instead of the toolsets passed to the agent constructor and agent run.
665667
tools: The tools to use instead of the tools registered with the agent.
668+
instructions: The instructions to use instead of the instructions registered with the agent.
666669
"""
667670
with super().override(deps=deps, model=model, toolsets=toolsets, tools=tools):
668671
yield

pydantic_ai_slim/pydantic_ai/durable_exec/hatchet/_function_toolset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async def tool_task(
6666
_ctx: Context,
6767
) -> ToolOutput:
6868
run_context = self.run_context_type.deserialize_run_context(
69-
input.serialized_run_context, deps=input.deps, hatchet_context=_ctx
69+
input.serialized_run_context, deps=input.deps
7070
)
7171
tool = (await wrapped.get_tools(run_context))[current_tool_name]
7272

pydantic_ai_slim/pydantic_ai/durable_exec/hatchet/_mcp_server.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ async def wrapped_get_tools_task(
8787
input: GetToolsInput[AgentDepsT],
8888
_ctx: Context,
8989
) -> dict[str, ToolDefinition]:
90-
run_context = self.run_context_type.deserialize_run_context(
91-
input.serialized_run_context, deps=input.deps, hatchet_context=_ctx
92-
)
90+
run_context = self.run_context_type.deserialize_run_context(input.serialized_run_context, deps=input.deps)
9391

9492
# ToolsetTool is not serializable as it holds a SchemaValidator (which is also the same for every MCP tool so unnecessary to pass along the wire every time),
9593
# so we just return the ToolDefinitions and wrap them in ToolsetTool outside of the activity.
@@ -120,9 +118,7 @@ async def wrapped_call_tool_task(
120118
input: CallToolInput[AgentDepsT],
121119
_ctx: Context,
122120
) -> CallToolOutput[AgentDepsT]:
123-
run_context = self.run_context_type.deserialize_run_context(
124-
input.serialized_run_context, deps=input.deps, hatchet_context=_ctx
125-
)
121+
run_context = self.run_context_type.deserialize_run_context(input.serialized_run_context, deps=input.deps)
126122
tool = self.tool_for_tool_def(input.tool_def)
127123

128124
result = await super(HatchetMCPServer, self).call_tool(input.name, input.tool_args, run_context, tool)

pydantic_ai_slim/pydantic_ai/durable_exec/hatchet/_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ async def wrapped_request_stream_task(
118118
assert self.event_stream_handler
119119

120120
run_context = self.run_context_type.deserialize_run_context(
121-
input.serialized_run_context, deps=input.serialized_run_context, hatchet_context=ctx
121+
input.serialized_run_context,
122+
deps=input.serialized_run_context,
122123
)
123124

124125
async with self.wrapped.request_stream(

0 commit comments

Comments
 (0)