@@ -196,7 +196,7 @@ async def validate(
196196
197197@dataclass
198198class BaseOutputSchema (ABC , Generic [OutputDataT ]):
199- allows_deferred_tool_requests : bool
199+ allows_deferred_tools : bool
200200
201201 @abstractmethod
202202 def with_default_mode (self , mode : StructuredOutputMode ) -> OutputSchema [OutputDataT ]:
@@ -250,8 +250,8 @@ def build( # noqa: C901
250250 raw_outputs = _flatten_output_spec (output_spec )
251251
252252 outputs = [output for output in raw_outputs if output is not DeferredToolRequests ]
253- allows_deferred_tool_requests = len (outputs ) < len (raw_outputs )
254- if len (outputs ) == 0 and allows_deferred_tool_requests :
253+ allows_deferred_tools = len (outputs ) < len (raw_outputs )
254+ if len (outputs ) == 0 and allows_deferred_tools :
255255 raise UserError ('At least one output type must be provided other than `DeferredToolRequests`.' )
256256
257257 if output := next ((output for output in outputs if isinstance (output , NativeOutput )), None ):
@@ -265,7 +265,7 @@ def build( # noqa: C901
265265 description = output .description ,
266266 strict = output .strict ,
267267 ),
268- allows_deferred_tool_requests = allows_deferred_tool_requests ,
268+ allows_deferred_tools = allows_deferred_tools ,
269269 )
270270 elif output := next ((output for output in outputs if isinstance (output , PromptedOutput )), None ):
271271 if len (outputs ) > 1 :
@@ -278,7 +278,7 @@ def build( # noqa: C901
278278 description = output .description ,
279279 ),
280280 template = output .template ,
281- allows_deferred_tool_requests = allows_deferred_tool_requests ,
281+ allows_deferred_tools = allows_deferred_tools ,
282282 )
283283
284284 text_outputs : Sequence [type [str ] | TextOutput [OutputDataT ]] = []
@@ -315,21 +315,19 @@ def build( # noqa: C901
315315 return ToolOrTextOutputSchema (
316316 processor = text_output_schema ,
317317 toolset = toolset ,
318- allows_deferred_tool_requests = allows_deferred_tool_requests ,
318+ allows_deferred_tools = allows_deferred_tools ,
319319 )
320320 else :
321- return PlainTextOutputSchema (
322- processor = text_output_schema , allows_deferred_tool_requests = allows_deferred_tool_requests
323- )
321+ return PlainTextOutputSchema (processor = text_output_schema , allows_deferred_tools = allows_deferred_tools )
324322
325323 if len (tool_outputs ) > 0 :
326- return ToolOutputSchema (toolset = toolset , allows_deferred_tool_requests = allows_deferred_tool_requests )
324+ return ToolOutputSchema (toolset = toolset , allows_deferred_tools = allows_deferred_tools )
327325
328326 if len (other_outputs ) > 0 :
329327 schema = OutputSchemaWithoutMode (
330328 processor = cls ._build_processor (other_outputs , name = name , description = description , strict = strict ),
331329 toolset = toolset ,
332- allows_deferred_tool_requests = allows_deferred_tool_requests ,
330+ allows_deferred_tools = allows_deferred_tools ,
333331 )
334332 if default_mode :
335333 schema = schema .with_default_mode (default_mode )
@@ -373,25 +371,19 @@ def __init__(
373371 self ,
374372 processor : ObjectOutputProcessor [OutputDataT ] | UnionOutputProcessor [OutputDataT ],
375373 toolset : OutputToolset [Any ] | None ,
376- allows_deferred_tool_requests : bool ,
374+ allows_deferred_tools : bool ,
377375 ):
378- super ().__init__ (allows_deferred_tool_requests )
376+ super ().__init__ (allows_deferred_tools )
379377 self .processor = processor
380378 self ._toolset = toolset
381379
382380 def with_default_mode (self , mode : StructuredOutputMode ) -> OutputSchema [OutputDataT ]:
383381 if mode == 'native' :
384- return NativeOutputSchema (
385- processor = self .processor , allows_deferred_tool_requests = self .allows_deferred_tool_requests
386- )
382+ return NativeOutputSchema (processor = self .processor , allows_deferred_tools = self .allows_deferred_tools )
387383 elif mode == 'prompted' :
388- return PromptedOutputSchema (
389- processor = self .processor , allows_deferred_tool_requests = self .allows_deferred_tool_requests
390- )
384+ return PromptedOutputSchema (processor = self .processor , allows_deferred_tools = self .allows_deferred_tools )
391385 elif mode == 'tool' :
392- return ToolOutputSchema (
393- toolset = self .toolset , allows_deferred_tool_requests = self .allows_deferred_tool_requests
394- )
386+ return ToolOutputSchema (toolset = self .toolset , allows_deferred_tools = self .allows_deferred_tools )
395387 else :
396388 assert_never (mode )
397389
@@ -554,8 +546,8 @@ async def process(
554546class ToolOutputSchema (OutputSchema [OutputDataT ]):
555547 _toolset : OutputToolset [Any ] | None
556548
557- def __init__ (self , toolset : OutputToolset [Any ] | None , allows_deferred_tool_requests : bool ):
558- super ().__init__ (allows_deferred_tool_requests )
549+ def __init__ (self , toolset : OutputToolset [Any ] | None , allows_deferred_tools : bool ):
550+ super ().__init__ (allows_deferred_tools )
559551 self ._toolset = toolset
560552
561553 @property
@@ -579,9 +571,9 @@ def __init__(
579571 self ,
580572 processor : PlainTextOutputProcessor [OutputDataT ] | None ,
581573 toolset : OutputToolset [Any ] | None ,
582- allows_deferred_tool_requests : bool ,
574+ allows_deferred_tools : bool ,
583575 ):
584- super ().__init__ (toolset = toolset , allows_deferred_tool_requests = allows_deferred_tool_requests )
576+ super ().__init__ (toolset = toolset , allows_deferred_tools = allows_deferred_tools )
585577 self .processor = processor
586578
587579 @property
0 commit comments