mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-01 02:02:20 +00:00
fix(agents): preserve nonreturning identity failure contract
This commit is contained in:
parent
4d36255d3e
commit
dd2cfa2643
1 changed files with 2 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
from collections.abc import Mapping
|
||||
from typing import Final
|
||||
from typing import Final, NoReturn
|
||||
|
||||
from fastapi import HTTPException
|
||||
|
||||
|
|
@ -48,5 +48,5 @@ def classify_agent_subject(
|
|||
return AgentSubject(kind="application", oid=oid, mode="autonomous")
|
||||
|
||||
|
||||
def raise_identity_failure(failure: AgentIdentityFailure, status_code: int = 403) -> None:
|
||||
def raise_identity_failure(failure: AgentIdentityFailure, status_code: int = 403) -> NoReturn:
|
||||
raise HTTPException(503 if failure.code == "policy_unavailable" else status_code, failure.message)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue