File tree Expand file tree Collapse file tree 4 files changed +18
-13
lines changed
examples/configs/abc_streaming Expand file tree Collapse file tree 4 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 3030 flows :
3131 - self check output
3232 streaming :
33- enabled : True
3433 window_size : 20
3534
3635 dialog :
Original file line number Diff line number Diff line change @@ -767,7 +767,9 @@ async def generate_bot_message(
767767 # as it is executed separately in llmrails.py
768768 # of course, it does not work when passed as context in `run_output_rails_in_streaming`
769769 # streaming_handler is set when stream_async method is used
770- if streaming_handler and self .config .rails .output .streaming .enabled :
770+
771+ if streaming_handler and len (self .config .rails .output .flows ) > 0 :
772+ # if streaming_handler and self.config.rails.output.streaming.enabled:
771773 context_updates ["skip_output_rails" ] = True
772774
773775 if bot_intent in self .config .bot_messages :
Original file line number Diff line number Diff line change @@ -1219,15 +1219,15 @@ def parse_object(cls, obj):
12191219
12201220 @property
12211221 def streaming_supported (self ):
1222- """Whether the current config supports streaming or not.
1223-
1224- Currently, we don't support streaming if there are output rails.
1225- """
1226- if len ( self . rails . output . flows ) > 0 :
1227- # if we have output rails streaming enabled
1228- if self .rails .output .streaming .enabled :
1229- return True
1230- return False
1222+ """Whether the current config supports streaming or not."""
1223+
1224+ # if len(self. rails.output.flows) > 0:
1225+ # # if we have output rails streaming enabled
1226+ # # we keep it in case it was needed when we have
1227+ # # support per rails
1228+ # if self.rails.output.streaming.enabled:
1229+ # return True
1230+ # return False
12311231
12321232 return True
12331233
Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ def _init_llms(self):
418418 self .runtime .register_action_param (
419419 model_name , getattr (self , model_name )
420420 )
421- # this is used for cotnent safety and topic control
421+ # this is used for content safety and topic control
422422 llms [llm_config .type ] = getattr (self , model_name )
423423
424424 self .runtime .register_action_param ("llms" , llms )
@@ -953,7 +953,11 @@ def stream_async(
953953 options = options ,
954954 )
955955 )
956- if self .config .rails .output .streaming .enabled :
956+ # TODO:
957+ # when we have output rails we wrap the streaming handler
958+ if len (self .config .rails .output .flows ) > 0 :
959+ #
960+ # if self.config.rails.output.streaming.enabled:
957961 # returns an async generator
958962 return self ._run_output_rails_in_streaming (
959963 streaming_handler = streaming_handler ,
You can’t perform that action at this time.
0 commit comments