mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(ui/team): annotate effectiveGuardrails as string[] for strict typecheck
Some checks failed
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled
Some checks failed
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled
The new effectiveGuardrails computation derived its element type from `info.metadata?.guardrails`, which is implicitly typed `any[]`, so the downstream `.map((name) => ...)` callback inferred `name` as implicit `any` and broke the production typecheck.
This commit is contained in:
parent
3d72e2a6f3
commit
30c2357fe3
1 changed files with 2 additions and 2 deletions
|
|
@ -610,10 +610,10 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
|||
|
||||
const initialKillSwitchOn = info.metadata?.disable_global_guardrails === true;
|
||||
const optedOutGlobals = new Set<string>(info.metadata?.opted_out_global_guardrails || []);
|
||||
const nonGlobalOptIns = (info.metadata?.guardrails || []).filter(
|
||||
const nonGlobalOptIns: string[] = (info.metadata?.guardrails || []).filter(
|
||||
(n: string) => !globalGuardrailNames.has(n),
|
||||
);
|
||||
const effectiveGuardrails = initialKillSwitchOn
|
||||
const effectiveGuardrails: string[] = initialKillSwitchOn
|
||||
? nonGlobalOptIns
|
||||
: [
|
||||
...Array.from(globalGuardrailNames).filter((n) => !optedOutGlobals.has(n)),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue