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 30
30
flows :
31
31
- self check output
32
32
streaming :
33
- enabled : True
34
33
window_size : 20
35
34
36
35
dialog :
Original file line number Diff line number Diff line change @@ -767,7 +767,9 @@ async def generate_bot_message(
767
767
# as it is executed separately in llmrails.py
768
768
# of course, it does not work when passed as context in `run_output_rails_in_streaming`
769
769
# 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:
771
773
context_updates ["skip_output_rails" ] = True
772
774
773
775
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):
1219
1219
1220
1220
@property
1221
1221
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
1231
1231
1232
1232
return True
1233
1233
Original file line number Diff line number Diff line change @@ -418,7 +418,7 @@ def _init_llms(self):
418
418
self .runtime .register_action_param (
419
419
model_name , getattr (self , model_name )
420
420
)
421
- # this is used for cotnent safety and topic control
421
+ # this is used for content safety and topic control
422
422
llms [llm_config .type ] = getattr (self , model_name )
423
423
424
424
self .runtime .register_action_param ("llms" , llms )
@@ -953,7 +953,11 @@ def stream_async(
953
953
options = options ,
954
954
)
955
955
)
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:
957
961
# returns an async generator
958
962
return self ._run_output_rails_in_streaming (
959
963
streaming_handler = streaming_handler ,
You can’t perform that action at this time.
0 commit comments