(UI) - Set/edit guardrails on a virtual key (#7954)

* Revert "JWT Auth - `enforce_rbac` support + UI team view, spend calc fix (#7863)"

This reverts commit dca6904937.

* Revert "Litellm dev 01 10 2025 p2 (#7679)"

This reverts commit c4780479a9.

* ui - allow setting guardrails on a key

* working edit guardrails

* fix edit guardrails on a key

* Revert "Revert "JWT Auth - `enforce_rbac` support + UI team view, spend calc fix (#7863)""

This reverts commit 8f7b9ae1af.

* Revert "Revert "Litellm dev 01 10 2025 p2 (#7679)""

This reverts commit a609139dde.

* fix edit guardrail on ui

* fix list_guardrails
This commit is contained in:
Ishaan Jaff 2025-01-23 18:01:54 -08:00 committed by GitHub
parent e6ec4f21e5
commit 84fb5aead8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 185 additions and 35 deletions

View file

@ -3050,3 +3050,31 @@ export const getProxyUISettings = async (
}
};
export const getGuardrailsList = async (accessToken: String) => {
try {
let url = proxyBaseUrl ? `${proxyBaseUrl}/guardrails/list` : `/guardrails/list`;
const response = await fetch(url, {
method: "GET",
headers: {
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
handleError(errorData);
throw new Error("Network response was not ok");
}
const data = await response.json();
console.log("Guardrails list response:", data);
return data;
} catch (error) {
console.error("Failed to fetch guardrails list:", error);
throw error;
}
};