(ui) show models page

This commit is contained in:
ishaan-jaff 2024-02-12 15:00:16 -08:00
parent 1ba56d8ff0
commit bc95d3f44b
4 changed files with 112 additions and 2 deletions

View file

@ -137,6 +137,41 @@ export const userInfoCall = async (
}
};
export const modelInfoCall = async (
accessToken: String,
userID: String,
userRole: String
) => {
try {
let url = proxyBaseUrl ? `${proxyBaseUrl}/model/info` : `/model/info`;
message.info("Requesting model data");
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
message.error(errorData);
throw new Error("Network response was not ok");
}
const data = await response.json();
message.info("Received model data");
return data;
// Handle success - you might want to update some state or UI based on the created key
} catch (error) {
console.error("Failed to create key:", error);
throw error;
}
};
export const keySpendLogsCall = async (accessToken: String, token: String) => {
try {
const url = proxyBaseUrl ? `${proxyBaseUrl}/spend/logs` : `/spend/logs`;