File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 119119LLM_TOKEN_EVENT = "token"
120120LLM_TOOL_CALL_EVENT = "tool_call"
121121LLM_TOOL_RESULT_EVENT = "tool_result"
122+ LLM_VALIDATION_EVENT = "validation"
122123
123124
124125def format_stream_data (d : dict ) -> str :
@@ -477,7 +478,7 @@ def _handle_shield_event(
477478 "id" : chunk_id ,
478479 "token" : "No Violation" ,
479480 },
480- event_type = LLM_TOKEN_EVENT ,
481+ event_type = LLM_VALIDATION_EVENT ,
481482 media_type = media_type ,
482483 )
483484 else :
@@ -491,7 +492,7 @@ def _handle_shield_event(
491492 "id" : chunk_id ,
492493 "token" : violation ,
493494 },
494- event_type = LLM_TOKEN_EVENT ,
495+ event_type = LLM_VALIDATION_EVENT ,
495496 media_type = media_type ,
496497 )
497498
Original file line number Diff line number Diff line change @@ -923,7 +923,7 @@ def test_stream_build_event_shield_call_step_complete_no_violation(mocker):
923923
924924 assert result is not None
925925 assert "data: " in result
926- assert '"event": "token "' in result
926+ assert '"event": "validation "' in result
927927 assert '"token": "No Violation"' in result
928928 # Role field removed for OLS compatibility
929929 assert '"id": 0' in result
@@ -963,7 +963,7 @@ def test_stream_build_event_shield_call_step_complete_with_violation(mocker):
963963
964964 assert result is not None
965965 assert "data: " in result
966- assert '"event": "token "' in result
966+ assert '"event": "validation "' in result
967967 assert (
968968 '"token": "Violation: I don\' t like the cut of your jib (Metadata: {})"'
969969 in result
You can’t perform that action at this time.
0 commit comments