This commit is contained in:
Timothy Jaeryang Baek
2026-01-24 04:13:19 +04:00
parent b7e9992d78
commit 32810b4152
4 changed files with 270 additions and 85 deletions
+35 -1
View File
@@ -238,6 +238,40 @@ export const updatePromptById = async (token: string, prompt: PromptItem) => {
return res;
};
export const updatePromptMetadata = async (
token: string,
promptId: string,
name: string,
command: string
) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/id/${promptId}/update/meta`, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
},
body: JSON.stringify({ name, command })
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
error = err.detail;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const setProductionPromptVersion = async (
token: string,
promptId: string,
@@ -245,7 +279,7 @@ export const setProductionPromptVersion = async (
) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/id/${promptId}/set/version`, {
const res = await fetch(`${WEBUI_API_BASE_URL}/prompts/id/${promptId}/update/version`, {
method: 'POST',
headers: {
Accept: 'application/json',