Skip to content

Commit 1bad3e5

Browse files
committed
Simplify AG-UI output_type logic
1 parent 5fb5675 commit 1bad3e5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pydantic_ai_slim/pydantic_ai/ag_ui.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -452,18 +452,10 @@ async def run(
452452

453453
history: _History = _convert_history(run_input.messages)
454454

455-
output_type_: OutputSpec[OutputDataT | DeferredToolCalls | RunOutputDataT]
456-
if output_type is None:
457-
# Use the agent's output type if not specified.
458-
output_type_ = [self.agent.output_type, DeferredToolCalls]
459-
else:
460-
output_type_ = [output_type, DeferredToolCalls]
461-
462455
run: AgentRun[AgentDepsT, Any]
463456
async with self.agent.iter(
464457
user_prompt=None,
465-
# TODO(steve): Could or should it just accept: [output_type, DeferredToolCalls]
466-
output_type=output_type_,
458+
output_type=[output_type or self.agent.output_type, DeferredToolCalls],
467459
message_history=history.messages,
468460
model=model,
469461
deps=deps,

0 commit comments

Comments
 (0)