mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix(proxy): add None guard to guardrail branch of streaming iterator hook
Apply the same None guard to the apply_guardrail branch for consistency, as flagged in PR review. All three callback dispatch branches now guard against None returns to prevent streaming chain breakage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7ea99461dd
commit
ba8459fda0
1 changed files with 3 additions and 1 deletions
|
|
@ -2122,13 +2122,15 @@ class ProxyLogging:
|
|||
current_response = _new_response
|
||||
elif "apply_guardrail" in type(_callback).__dict__:
|
||||
request_data["guardrail_to_apply"] = callback
|
||||
current_response = (
|
||||
_new_response = (
|
||||
unified_guardrail.async_post_call_streaming_iterator_hook(
|
||||
user_api_key_dict=user_api_key_dict,
|
||||
request_data=request_data,
|
||||
response=current_response,
|
||||
)
|
||||
)
|
||||
if _new_response is not None:
|
||||
current_response = _new_response
|
||||
else:
|
||||
_new_response = (
|
||||
_callback.async_post_call_streaming_iterator_hook(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue