File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -506,9 +506,10 @@ fn process_event_converter<T: Serialize>(
506
506
response_collector. observe_current_osl ( metrics. output_tokens ) ;
507
507
response_collector. observe_response ( metrics. input_tokens , metrics. chunk_tokens ) ;
508
508
509
- // Chomp the LLMMetricAnnotation so it's not returned in the response stream
510
- // TODO: add a flag to control what is returned in the SSE stream
511
- if annotated. event . as_deref ( ) == Some ( crate :: preprocessor:: ANNOTATION_LLM_METRICS ) {
509
+ // Only filter out metrics if DYN_RICH_EVENT_STREAM is not set
510
+ if std:: env:: var ( "DYN_RICH_EVENT_STREAM" ) . is_err ( )
511
+ && annotated. event . as_deref ( ) == Some ( crate :: preprocessor:: ANNOTATION_LLM_METRICS )
512
+ {
512
513
annotated. event = None ;
513
514
annotated. comment = None ;
514
515
}
You can’t perform that action at this time.
0 commit comments