@@ -215,7 +215,6 @@ def run_stream_native(
215215 * ,
216216 output_type : OutputSpec [Any ] | None = None ,
217217 message_history : Sequence [ModelMessage ] | None = None ,
218- deferred_tool_results : DeferredToolResults | None = None ,
219218 model : Model | KnownModelName | str | None = None ,
220219 instructions : Instructions [AgentDepsT ] = None ,
221220 deps : AgentDepsT = None ,
@@ -232,7 +231,6 @@ def run_stream_native(
232231 output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
233232 output validators since output validators would expect an argument that matches the agent's output type.
234233 message_history: History of the conversation so far.
235- deferred_tool_results: Optional results for deferred tool calls in the message history.
236234 model: Optional model to use for this run, required if `model` was not set when creating the agent.
237235 instructions: Optional additional instructions to use for this run.
238236 deps: Optional dependencies to use for this run.
@@ -243,10 +241,6 @@ def run_stream_native(
243241 toolsets: Optional additional toolsets for this run.
244242 builtin_tools: Optional additional builtin tools to use for this run.
245243 """
246- # Use instance field as fallback if not explicitly passed
247- if deferred_tool_results is None :
248- deferred_tool_results = self .deferred_tool_results
249-
250244 message_history = [* (message_history or []), * self .messages ]
251245
252246 toolset = self .toolset
@@ -272,7 +266,7 @@ def run_stream_native(
272266 return self .agent .run_stream_events (
273267 output_type = output_type ,
274268 message_history = message_history ,
275- deferred_tool_results = deferred_tool_results ,
269+ deferred_tool_results = self . deferred_tool_results ,
276270 model = model ,
277271 deps = deps ,
278272 model_settings = model_settings ,
@@ -289,7 +283,6 @@ def run_stream(
289283 * ,
290284 output_type : OutputSpec [Any ] | None = None ,
291285 message_history : Sequence [ModelMessage ] | None = None ,
292- deferred_tool_results : DeferredToolResults | None = None ,
293286 model : Model | KnownModelName | str | None = None ,
294287 instructions : Instructions [AgentDepsT ] = None ,
295288 deps : AgentDepsT = None ,
@@ -307,7 +300,6 @@ def run_stream(
307300 output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
308301 output validators since output validators would expect an argument that matches the agent's output type.
309302 message_history: History of the conversation so far.
310- deferred_tool_results: Optional results for deferred tool calls in the message history.
311303 model: Optional model to use for this run, required if `model` was not set when creating the agent.
312304 instructions: Optional additional instructions to use for this run.
313305 deps: Optional dependencies to use for this run.
@@ -324,7 +316,6 @@ def run_stream(
324316 self .run_stream_native (
325317 output_type = output_type ,
326318 message_history = message_history ,
327- deferred_tool_results = deferred_tool_results ,
328319 model = model ,
329320 instructions = instructions ,
330321 deps = deps ,
@@ -345,7 +336,6 @@ async def dispatch_request(
345336 * ,
346337 agent : AbstractAgent [DispatchDepsT , DispatchOutputDataT ],
347338 message_history : Sequence [ModelMessage ] | None = None ,
348- deferred_tool_results : DeferredToolResults | None = None ,
349339 model : Model | KnownModelName | str | None = None ,
350340 instructions : Instructions [DispatchDepsT ] = None ,
351341 deps : DispatchDepsT = None ,
@@ -366,7 +356,6 @@ async def dispatch_request(
366356 output_type: Custom output type to use for this run, `output_type` may only be used if the agent has no
367357 output validators since output validators would expect an argument that matches the agent's output type.
368358 message_history: History of the conversation so far.
369- deferred_tool_results: Optional results for deferred tool calls in the message history.
370359 model: Optional model to use for this run, required if `model` was not set when creating the agent.
371360 instructions: Optional additional instructions to use for this run.
372361 deps: Optional dependencies to use for this run.
@@ -406,7 +395,6 @@ async def dispatch_request(
406395 return adapter .streaming_response (
407396 adapter .run_stream (
408397 message_history = message_history ,
409- deferred_tool_results = deferred_tool_results ,
410398 deps = deps ,
411399 output_type = output_type ,
412400 model = model ,
0 commit comments