import request from "@/utils/request";
|
|
export const getAiConfigSummary = async (promptCode = "home.default") => {
|
const res = await request.get("ai/config/summary", { params: { promptCode } });
|
const { code, msg, data } = res.data;
|
if (code === 200) {
|
return data;
|
}
|
throw new Error(msg || "获取 AI 运行态摘要失败");
|
};
|
|
export const validateAiParamDraft = async (payload) => {
|
const res = await request.post("aiParam/validate-draft", payload);
|
const { code, msg, data } = res.data;
|
if (code === 200) {
|
return data;
|
}
|
throw new Error(msg || "AI 参数验证失败");
|
};
|
|
export const renderAiPromptPreview = async (payload) => {
|
const res = await request.post("aiPrompt/render-preview", payload);
|
const { code, msg, data } = res.data;
|
if (code === 200) {
|
return data;
|
}
|
throw new Error(msg || "Prompt 预览失败");
|
};
|