feat: add LLM配置 management page (profiles view)
This commit is contained in:
@@ -43,4 +43,26 @@ const API = {
|
||||
return API.post("/api/evaluations", { scenario_path: scenarioPath });
|
||||
},
|
||||
taskStatus(taskId) { return API.get(`/api/evaluations/${encodeURIComponent(taskId)}`); },
|
||||
|
||||
// LLM Profile API
|
||||
profiles() { return API.get("/api/llm-profiles"); },
|
||||
createProfile(body) { return API.post("/api/llm-profiles", body); },
|
||||
updateProfile(id, body) {
|
||||
return fetch(`/api/llm-profiles/${encodeURIComponent(id)}`, {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(body),
|
||||
}).then(async r => {
|
||||
if (!r.ok) { const d = await API._extractError(r); throw new Error(d); }
|
||||
return r.json();
|
||||
});
|
||||
},
|
||||
deleteProfile(id) {
|
||||
return fetch(`/api/llm-profiles/${encodeURIComponent(id)}`, { method: "DELETE" })
|
||||
.then(async r => {
|
||||
if (!r.ok) { const d = await API._extractError(r); throw new Error(d); }
|
||||
return r.json();
|
||||
});
|
||||
},
|
||||
applyProfiles(body) { return API.post("/api/llm-profiles/apply", body); },
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user