Allow viewing keyinfo on request logs (#9568)

* feat(view_logs.tsx): show model id + api base in request logs

easier debugging

* fix(index.tsx): fix length of api base

easier viewing

* build(ui/): initial commit allowing user to click into key from request logs

allows easier debugging of 'what key is this?
This commit is contained in:
Krish Dholakia 2025-03-26 23:11:15 -07:00 committed by GitHub
parent d58fe5a9f9
commit c453a91849
5 changed files with 72 additions and 11 deletions

View file

@ -2372,6 +2372,7 @@ export const testConnectionRequest = async (
// ... existing code ...
export const keyInfoV1Call = async (accessToken: string, key: string) => {
try {
console.log("entering keyInfoV1Call");
let url = proxyBaseUrl ? `${proxyBaseUrl}/key/info` : `/key/info`;
url = `${url}?key=${key}`; // Add key as query parameter
@ -2384,13 +2385,16 @@ export const keyInfoV1Call = async (accessToken: string, key: string) => {
// Remove body since this is a GET request
});
console.log("response", response);
if (!response.ok) {
const errorData = await response.text();
handleError(errorData);
throw new Error("Network response was not ok");
message.error("Failed to fetch key info - " + errorData);
}
const data = await response.json();
console.log("data", data);
return data;
} catch (error) {
console.error("Failed to fetch key info:", error);