Skip to content

Commit 2ab33e8

Browse files
committed
fix lint and a test
1 parent 766d223 commit 2ab33e8

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pydantic_ai_slim/pydantic_ai/_function_schema.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ class FunctionSchema:
5757
async def call(self, args_dict: dict[str, Any], ctx: RunContext[Any]) -> Any:
5858
args, kwargs = self._call_args(args_dict, ctx)
5959
if self.is_async_iterator:
60-
assert ctx.event_stream is not None, (
61-
'RunContext.event_stream needs to be set to use FunctionSchema.call with async iterators'
62-
)
63-
6460
return_value: Return | None = None
6561
async for event_data in self.function(*args, **kwargs):
6662
if return_value is not None:

tests/test_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4378,7 +4378,7 @@ def analyze_data() -> list[Any]:
43784378

43794379
with pytest.raises(
43804380
UserError,
4381-
match="The return value of tool 'analyze_data' contains invalid nested `ToolReturn` objects. `ToolReturn` should be used directly.",
4381+
match="The return value of tool 'analyze_data' contains invalid nested `Return` objects. `Return` should be used directly.",
43824382
):
43834383
agent.run_sync('Please analyze the data')
43844384

0 commit comments

Comments
 (0)