File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def chat(
8383
8484 framework = ctx .ensure_object (BubFramework )
8585
86- manager = ChannelManager (framework , enabled_channels = ["cli" ])
86+ manager = ChannelManager (framework , enabled_channels = ["cli" ], stream_output = True )
8787 channel = manager .get_channel ("cli" )
8888 if channel is None :
8989 typer .echo ("CLI channel not found. Please check your hook implementations." )
Original file line number Diff line number Diff line change @@ -39,10 +39,16 @@ class ChannelSettings(BaseSettings):
3939
4040
4141class ChannelManager :
42- def __init__ (self , framework : BubFramework , enabled_channels : Collection [str ] | None = None ) -> None :
42+ def __init__ (
43+ self ,
44+ framework : BubFramework ,
45+ enabled_channels : Collection [str ] | None = None ,
46+ stream_output : bool | None = None ,
47+ ) -> None :
4348 self .framework = framework
4449 self ._channels : dict [str , Channel ] = self .framework .get_channels (self .on_receive )
4550 self ._settings = ChannelSettings ()
51+ self ._stream_output = stream_output if stream_output is not None else self ._settings .stream_output
4652 if enabled_channels is not None :
4753 self ._enabled_channels = list (enabled_channels )
4854 else :
@@ -139,7 +145,7 @@ async def listen_and_run(self) -> None:
139145 try :
140146 while True :
141147 message = await wait_until_stopped (self ._messages .get (), stop_event )
142- task = asyncio .create_task (self .framework .process_inbound (message , self ._settings . stream_output ))
148+ task = asyncio .create_task (self .framework .process_inbound (message , self ._stream_output ))
143149 task .add_done_callback (functools .partial (self ._on_task_done , message .session_id ))
144150 self ._ongoing_tasks .setdefault (message .session_id , set ()).add (task )
145151 except asyncio .CancelledError :
You can’t perform that action at this time.
0 commit comments