Skip to content

Commit 62d975a

Browse files
committed
chore(ag-ui): support additional toolsets
Update to support the new `toolsets` behaviour which is now additional instead of replacing the existing toolsets.
1 parent efcac44 commit 62d975a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pydantic_ai_slim/pydantic_ai/ag_ui.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,7 @@ async def run(
358358
for tool in run_input.tools
359359
]
360360
)
361-
# Maintain the current user toolsets if they exist, otherwise use the provided toolset.
362-
user_toolsets: list[AbstractToolset[AgentDepsT]] = (
363-
list(self.agent._user_toolsets) if toolsets is None else list(toolsets) # type: ignore[reportPrivateUsage]
364-
)
365-
# Add the AG-UI toolset to the user toolsets.
366-
user_toolsets.append(toolset)
367-
toolsets = user_toolsets
361+
toolsets = list(toolsets or []) + [toolset]
368362

369363
try:
370364
yield encoder.encode(

0 commit comments

Comments
 (0)