refac
This commit is contained in:
1 parent
90ca2e9b0f
commit
cdc2b3bf85
3 files changed
+48
-2
No files matched your search
@@ -442,6 +442,33 @@ export const setCodeExecutionConfig = async (token: string, config: object) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getModelsDefaults = async (token: string) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/configs/models/defaults`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
error = err.detail;
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getModelsConfig = async (token: string) => {
|
||||
let error = null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user