mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix(proxy): annotate the guardrail headers kept across upstream failure logging
This commit is contained in:
parent
4ec3750fb9
commit
cee2c79a97
1 changed files with 2 additions and 2 deletions
|
|
@ -1446,8 +1446,8 @@ async def _log_passthrough_upstream_failure_keeping_guardrail_headers(
|
|||
"""Log an upstream error like ``_log_passthrough_upstream_failure`` and return the guardrail response headers,
|
||||
read before the failure hooks rebuild ``kwargs``' metadata without the guardrail fields. A successful response
|
||||
has no failure hooks to read around, so it returns none."""
|
||||
guardrail_headers: Final = (
|
||||
_guardrail_response_headers(parsed_body, kwargs) if response.status_code >= 400 else MappingProxyType({})
|
||||
guardrail_headers: Final[Mapping[str, str]] = (
|
||||
_guardrail_response_headers(parsed_body, kwargs) if response.status_code >= 400 else {}
|
||||
)
|
||||
await _log_passthrough_upstream_failure(
|
||||
response=response,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue