@@ -118,7 +118,7 @@ class RunConfig:
118
118
119
119
class Runner (abc .ABC ):
120
120
@abc .abstractmethod
121
- async def run_impl (
121
+ async def _run_impl (
122
122
self ,
123
123
starting_agent : Agent [TContext ],
124
124
input : str | list [TResponseInputItem ],
@@ -132,7 +132,7 @@ async def run_impl(
132
132
pass
133
133
134
134
@abc .abstractmethod
135
- def run_sync_impl (
135
+ def _run_sync_impl (
136
136
self ,
137
137
starting_agent : Agent [TContext ],
138
138
input : str | list [TResponseInputItem ],
@@ -146,7 +146,7 @@ def run_sync_impl(
146
146
pass
147
147
148
148
@abc .abstractmethod
149
- def run_streamed_impl (
149
+ def _run_streamed_impl (
150
150
self ,
151
151
starting_agent : Agent [TContext ],
152
152
input : str | list [TResponseInputItem ],
@@ -197,7 +197,7 @@ async def run(
197
197
agent. Agents may perform handoffs, so we don't know the specific type of the output.
198
198
"""
199
199
runner = DEFAULT_RUNNER or DefaultRunner ()
200
- return await runner .run_impl (
200
+ return await runner ._run_impl (
201
201
starting_agent ,
202
202
input ,
203
203
context = context ,
@@ -249,7 +249,7 @@ def run_sync(
249
249
agent. Agents may perform handoffs, so we don't know the specific type of the output.
250
250
"""
251
251
runner = DEFAULT_RUNNER or DefaultRunner ()
252
- return runner .run_sync_impl (
252
+ return runner ._run_sync_impl (
253
253
starting_agent ,
254
254
input ,
255
255
context = context ,
@@ -297,7 +297,7 @@ def run_streamed(
297
297
A result object that contains data about the run, as well as a method to stream events.
298
298
"""
299
299
runner = DEFAULT_RUNNER or DefaultRunner ()
300
- return runner .run_streamed_impl (
300
+ return runner ._run_streamed_impl (
301
301
starting_agent ,
302
302
input ,
303
303
context = context ,
@@ -339,7 +339,7 @@ def _get_model(cls, agent: Agent[Any], run_config: RunConfig) -> Model:
339
339
340
340
341
341
class DefaultRunner (Runner ):
342
- async def run_impl (
342
+ async def _run_impl (
343
343
self ,
344
344
starting_agent : Agent [TContext ],
345
345
input : str | list [TResponseInputItem ],
@@ -488,7 +488,7 @@ async def run_impl(
488
488
if current_span :
489
489
current_span .finish (reset_current = True )
490
490
491
- def run_sync_impl (
491
+ def _run_sync_impl (
492
492
self ,
493
493
starting_agent : Agent [TContext ],
494
494
input : str | list [TResponseInputItem ],
@@ -511,7 +511,7 @@ def run_sync_impl(
511
511
)
512
512
)
513
513
514
- def run_streamed_impl (
514
+ def _run_streamed_impl (
515
515
self ,
516
516
starting_agent : Agent [TContext ],
517
517
input : str | list [TResponseInputItem ],
@@ -564,7 +564,7 @@ def run_streamed_impl(
564
564
565
565
# Kick off the actual agent loop in the background and return the streamed result object.
566
566
streamed_result ._run_impl_task = asyncio .create_task (
567
- self ._run_streamed_impl (
567
+ self ._start_streaming (
568
568
starting_input = input ,
569
569
streamed_result = streamed_result ,
570
570
starting_agent = starting_agent ,
@@ -621,7 +621,7 @@ async def _run_input_guardrails_with_queue(
621
621
streamed_result .input_guardrail_results = guardrail_results
622
622
623
623
@classmethod
624
- async def _run_streamed_impl (
624
+ async def _start_streaming (
625
625
cls ,
626
626
starting_input : str | list [TResponseInputItem ],
627
627
streamed_result : RunResultStreaming ,
0 commit comments