Skip to content

Commit 290741d

Browse files
committed
rename o to output for consistency; remove unneeded assert
1 parent d84608d commit 290741d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/test_agent.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,9 @@ async def stream_model(messages: list[ModelMessage], info: AgentInfo) -> AsyncIt
397397
agent = Agent(FunctionModel(stream_function=stream_model), output_type=Foo)
398398

399399
@agent.output_validator
400-
def validate_output(ctx: RunContext[None], o: Foo, partial: bool) -> Foo:
401-
call_log.append((o, partial))
402-
assert ctx.tool_name == 'final_result'
403-
return o
400+
def validate_output(ctx: RunContext[None], output: Foo, partial: bool) -> Foo:
401+
call_log.append((output, partial))
402+
return output
404403

405404
async with agent.run_stream('Hello') as result:
406405
outputs = [output async for output in result.stream_output(debounce_by=None)]

0 commit comments

Comments
 (0)