Skip to content

Commit 22e2ac2

Browse files
committed
revert toolsets to main
1 parent 82d20f7 commit 22e2ac2

File tree

10 files changed

+10
-51
lines changed

10 files changed

+10
-51
lines changed

pydantic_ai_slim/pydantic_ai/toolsets/_dynamic.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
6767
return await self._toolset.get_tools(ctx)
6868

6969
async def call_tool(
70-
self,
71-
name: str,
72-
tool_args: dict[str, Any],
73-
ctx: RunContext[AgentDepsT],
74-
tool: ToolsetTool[AgentDepsT],
70+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
7571
) -> Any:
7672
assert self._toolset is not None
7773
return await self._toolset.call_tool(name, tool_args, ctx, tool)

pydantic_ai_slim/pydantic_ai/toolsets/abstract.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
116116

117117
@abstractmethod
118118
async def call_tool(
119-
self,
120-
name: str,
121-
tool_args: dict[str, Any],
122-
ctx: RunContext[AgentDepsT],
123-
tool: ToolsetTool[AgentDepsT],
119+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
124120
) -> Any:
125121
"""Call a tool with the given arguments.
126122
@@ -129,7 +125,6 @@ async def call_tool(
129125
tool_args: The arguments to pass to the tool.
130126
ctx: The run context.
131127
tool: The tool definition returned by [`get_tools`][pydantic_ai.toolsets.AbstractToolset.get_tools] that was called.
132-
allow_partial: Whether partial validation is allowed.
133128
"""
134129
raise NotImplementedError()
135130

pydantic_ai_slim/pydantic_ai/toolsets/approval_required.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ class ApprovalRequiredToolset(WrapperToolset[AgentDepsT]):
2424
)
2525

2626
async def call_tool(
27-
self,
28-
name: str,
29-
tool_args: dict[str, Any],
30-
ctx: RunContext[AgentDepsT],
31-
tool: ToolsetTool[AgentDepsT],
27+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
3228
) -> Any:
3329
if not ctx.tool_call_approved and self.approval_required_func(ctx, tool.tool_def, tool_args):
3430
raise ApprovalRequired

pydantic_ai_slim/pydantic_ai/toolsets/combined.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
8484
return all_tools
8585

8686
async def call_tool(
87-
self,
88-
name: str,
89-
tool_args: dict[str, Any],
90-
ctx: RunContext[AgentDepsT],
91-
tool: ToolsetTool[AgentDepsT],
87+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
9288
) -> Any:
9389
assert isinstance(tool, _CombinedToolsetTool)
9490
return await tool.source_toolset.call_tool(name, tool_args, ctx, tool.source_tool)

pydantic_ai_slim/pydantic_ai/toolsets/external.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
4242
}
4343

4444
async def call_tool(
45-
self,
46-
name: str,
47-
tool_args: dict[str, Any],
48-
ctx: RunContext[AgentDepsT],
49-
tool: ToolsetTool[AgentDepsT],
45+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
5046
) -> Any:
5147
raise NotImplementedError('External tools cannot be called directly')
5248

pydantic_ai_slim/pydantic_ai/toolsets/fastmcp.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
139139
}
140140

141141
async def call_tool(
142-
self,
143-
name: str,
144-
tool_args: dict[str, Any],
145-
ctx: RunContext[AgentDepsT],
146-
tool: ToolsetTool[AgentDepsT],
142+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
147143
) -> Any:
148144
async with self:
149145
try:

pydantic_ai_slim/pydantic_ai/toolsets/function.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
344344
return tools
345345

346346
async def call_tool(
347-
self,
348-
name: str,
349-
tool_args: dict[str, Any],
350-
ctx: RunContext[AgentDepsT],
351-
tool: ToolsetTool[AgentDepsT],
347+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
352348
) -> Any:
353349
assert isinstance(tool, FunctionToolsetTool)
354350
return await tool.call_func(tool_args, ctx)

pydantic_ai_slim/pydantic_ai/toolsets/prefixed.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
3333
}
3434

3535
async def call_tool(
36-
self,
37-
name: str,
38-
tool_args: dict[str, Any],
39-
ctx: RunContext[AgentDepsT],
40-
tool: ToolsetTool[AgentDepsT],
36+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
4137
) -> Any:
4238
original_name = name.removeprefix(self.prefix + '_')
4339
ctx = replace(ctx, tool_name=original_name)

pydantic_ai_slim/pydantic_ai/toolsets/renamed.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
3434
return tools
3535

3636
async def call_tool(
37-
self,
38-
name: str,
39-
tool_args: dict[str, Any],
40-
ctx: RunContext[AgentDepsT],
41-
tool: ToolsetTool[AgentDepsT],
37+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
4238
) -> Any:
4339
original_name = self.name_map.get(name, name)
4440
ctx = replace(ctx, tool_name=original_name)

pydantic_ai_slim/pydantic_ai/toolsets/wrapper.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ async def get_tools(self, ctx: RunContext[AgentDepsT]) -> dict[str, ToolsetTool[
3838
return await self.wrapped.get_tools(ctx)
3939

4040
async def call_tool(
41-
self,
42-
name: str,
43-
tool_args: dict[str, Any],
44-
ctx: RunContext[AgentDepsT],
45-
tool: ToolsetTool[AgentDepsT],
41+
self, name: str, tool_args: dict[str, Any], ctx: RunContext[AgentDepsT], tool: ToolsetTool[AgentDepsT]
4642
) -> Any:
4743
return await self.wrapped.call_tool(name, tool_args, ctx, tool)
4844

0 commit comments

Comments
 (0)