Skip to content

Commit 82d20f7

Browse files
committed
remove allow_partial from call_tool
1 parent 2322a2a commit 82d20f7

File tree

19 files changed

+11
-30
lines changed

19 files changed

+11
-30
lines changed

pydantic_ai_slim/pydantic_ai/durable_exec/dbos/_mcp_server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,5 @@ async def call_tool(
8686
tool_args: dict[str, Any],
8787
ctx: RunContext[AgentDepsT],
8888
tool: ToolsetTool[AgentDepsT],
89-
allow_partial: bool = False,
9089
) -> ToolResult:
9190
return await self._dbos_wrapped_call_tool_step(name, tool_args, ctx, tool)

pydantic_ai_slim/pydantic_ai/durable_exec/prefect/_function_toolset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ async def call_tool(
4242
tool_args: dict[str, Any],
4343
ctx: RunContext[AgentDepsT],
4444
tool: ToolsetTool[AgentDepsT],
45-
allow_partial: bool = False,
4645
) -> Any:
4746
"""Call a tool, wrapped as a Prefect task with a descriptive name."""
4847
# Check if this specific tool has custom config or is disabled
4948
tool_specific_config = self._tool_task_config.get(name, default_task_config)
5049
if tool_specific_config is None:
5150
# None means this tool should not be wrapped as a task
52-
return await super().call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
51+
return await super().call_tool(name, tool_args, ctx, tool)
5352

5453
# Merge tool-specific config with default config
5554
merged_config = self._task_config | tool_specific_config

pydantic_ai_slim/pydantic_ai/durable_exec/prefect/_mcp_server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ async def call_tool(
5353
tool_args: dict[str, Any],
5454
ctx: RunContext[AgentDepsT],
5555
tool: ToolsetTool[AgentDepsT],
56-
allow_partial: bool = False,
5756
) -> ToolResult:
5857
"""Call an MCP tool, wrapped as a Prefect task with a descriptive name."""
5958
return await self._call_tool_task.with_options(name=f'Call MCP Tool: {name}', **self._task_config)(

pydantic_ai_slim/pydantic_ai/durable_exec/temporal/_function_toolset.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ async def call_tool(
111111
tool_args: dict[str, Any],
112112
ctx: RunContext[AgentDepsT],
113113
tool: ToolsetTool[AgentDepsT],
114-
allow_partial: bool = False,
115114
) -> Any:
116115
if not workflow.in_workflow():
117-
return await super().call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
116+
return await super().call_tool(name, tool_args, ctx, tool)
118117

119118
tool_activity_config = self.tool_activity_config.get(name, {})
120119
if tool_activity_config is False:
@@ -124,7 +123,7 @@ async def call_tool(
124123
f'Temporal activity config for tool {name!r} has been explicitly set to `False` (activity disabled), '
125124
'but non-async tools are run in threads which are not supported outside of an activity. Make the tool function async instead.'
126125
)
127-
return await super().call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
126+
return await super().call_tool(name, tool_args, ctx, tool)
128127

129128
tool_activity_config = self.activity_config | tool_activity_config
130129
serialized_run_context = self.run_context_type.serialize_run_context(ctx)

pydantic_ai_slim/pydantic_ai/durable_exec/temporal/_mcp_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ async def call_tool(
125125
tool_args: dict[str, Any],
126126
ctx: RunContext[AgentDepsT],
127127
tool: ToolsetTool[AgentDepsT],
128-
allow_partial: bool = False,
129128
) -> ToolResult:
130129
if not workflow.in_workflow():
131-
return await super().call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
130+
return await super().call_tool(name, tool_args, ctx, tool)
132131

133132
tool_activity_config = self.activity_config | self.tool_activity_config.get(name, {})
134133
serialized_run_context = self.run_context_type.serialize_run_context(ctx)

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ async def call_tool(
267267
tool_args: dict[str, Any],
268268
ctx: RunContext[Any],
269269
tool: ToolsetTool[Any],
270-
allow_partial: bool = False,
271270
) -> ToolResult:
272271
if self.tool_prefix:
273272
name = name.removeprefix(f'{self.tool_prefix}_')

pydantic_ai_slim/pydantic_ai/toolsets/_dynamic.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,9 @@ async def call_tool(
7272
tool_args: dict[str, Any],
7373
ctx: RunContext[AgentDepsT],
7474
tool: ToolsetTool[AgentDepsT],
75-
allow_partial: bool = False,
7675
) -> Any:
7776
assert self._toolset is not None
78-
return await self._toolset.call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
77+
return await self._toolset.call_tool(name, tool_args, ctx, tool)
7978

8079
def apply(self, visitor: Callable[[AbstractToolset[AgentDepsT]], None]) -> None:
8180
if self._toolset is None:

pydantic_ai_slim/pydantic_ai/toolsets/abstract.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ async def call_tool(
121121
tool_args: dict[str, Any],
122122
ctx: RunContext[AgentDepsT],
123123
tool: ToolsetTool[AgentDepsT],
124-
allow_partial: bool = False,
125124
) -> Any:
126125
"""Call a tool with the given arguments.
127126

pydantic_ai_slim/pydantic_ai/toolsets/approval_required.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ async def call_tool(
2929
tool_args: dict[str, Any],
3030
ctx: RunContext[AgentDepsT],
3131
tool: ToolsetTool[AgentDepsT],
32-
allow_partial: bool = False,
3332
) -> Any:
3433
if not ctx.tool_call_approved and self.approval_required_func(ctx, tool.tool_def, tool_args):
3534
raise ApprovalRequired
3635

37-
return await super().call_tool(name, tool_args, ctx, tool, allow_partial=allow_partial)
36+
return await super().call_tool(name, tool_args, ctx, tool)

pydantic_ai_slim/pydantic_ai/toolsets/combined.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@ async def call_tool(
8989
tool_args: dict[str, Any],
9090
ctx: RunContext[AgentDepsT],
9191
tool: ToolsetTool[AgentDepsT],
92-
allow_partial: bool = False,
9392
) -> Any:
9493
assert isinstance(tool, _CombinedToolsetTool)
95-
return await tool.source_toolset.call_tool(name, tool_args, ctx, tool.source_tool, allow_partial=allow_partial)
94+
return await tool.source_toolset.call_tool(name, tool_args, ctx, tool.source_tool)
9695

9796
def apply(self, visitor: Callable[[AbstractToolset[AgentDepsT]], None]) -> None:
9897
for toolset in self.toolsets:

0 commit comments

Comments
 (0)