File tree Expand file tree Collapse file tree 3 files changed +14
-10
lines changed
src/strands/experimental/bidi Expand file tree Collapse file tree 3 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -422,20 +422,24 @@ async def run_outputs():
422422 await output (event )
423423
424424 for input_ in inputs :
425- await input_ .start ()
425+ if hasattr (input_ , "start" ):
426+ await input_ .start ()
426427
427428 for output in outputs :
428- await output .start ()
429+ if hasattr (output , "start" ):
430+ await output .start ()
429431
430432 try :
431433 await asyncio .gather (run_inputs (), run_outputs (), return_exceptions = True )
432434
433435 finally :
434436 for input_ in inputs :
435- await input_ .stop ()
437+ if hasattr (input_ , "stop" ):
438+ await input_ .stop ()
436439
437440 for output in outputs :
438- await output .stop ()
441+ if hasattr (output , "stop" ):
442+ await output .stop ()
439443
440444 def _validate_active_connection (self ) -> None :
441445 """Validate that an active connection exists.
Original file line number Diff line number Diff line change 1717
1818
1919class _BidiAudioInput (BidiInput ):
20- "Handle audio input from bidi agent."
20+ """ Handle audio input from bidi agent."" "
2121 def __init__ (self , audio : "BidiAudioIO" ) -> None :
2222 """Store reference to pyaudio instance."""
2323 self .audio = audio
@@ -43,7 +43,7 @@ async def __call__(self) -> BidiAudioInputEvent:
4343
4444
4545class _BidiAudioOutput (BidiOutput ):
46- "Handle audio output from bidi agent."
46+ """ Handle audio output from bidi agent."" "
4747 def __init__ (self , audio : "BidiAudioIO" ) -> None :
4848 """Store reference to pyaudio instance."""
4949 self .audio = audio
@@ -115,11 +115,11 @@ def __init__(
115115 self .interrupted = False
116116
117117 def input (self ) -> _BidiAudioInput :
118- "Return audio processing BidiInput"
118+ """ Return audio processing BidiInput"" "
119119 return _BidiAudioInput (self )
120120
121121 def output (self ) -> _BidiAudioOutput :
122- "Return audio processing BidiOutput"
122+ """ Return audio processing BidiOutput"" "
123123 return _BidiAudioOutput (self )
124124
125125 def _start (self ) -> None :
Original file line number Diff line number Diff line change 99
1010
1111class _BidiTextOutput (BidiOutput ):
12- "Handle text output from bidi agent."
12+ """ Handle text output from bidi agent."" "
1313 async def __call__ (self , event : BidiOutputEvent ) -> None :
1414 """Print text events to stdout."""
1515
@@ -25,7 +25,7 @@ async def __call__(self, event: BidiOutputEvent) -> None:
2525
2626
2727class BidiTextIO :
28- "Handle text input and output from bidi agent."
28+ """ Handle text input and output from bidi agent."" "
2929 def output (self ) -> _BidiTextOutput :
3030 "Return text processing BidiOutput"
3131 return _BidiTextOutput ()
You can’t perform that action at this time.
0 commit comments