You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
968 B

import { defineWrappedResponseHandler } from "#server/utils/handler";
import { R } from "#server/utils/response";
import { requireAdmin } from "#server/utils/admin-guard";
import { getConfigGlobal } from "#server/utils/context";
import { listSystemModels } from "#server/service/llm";
export default defineWrappedResponseHandler(async (event) => {
await requireAdmin(event);
const [systemPrompt, defaultModelId, titleModelId, publicToolSlugs] = await Promise.all([
getConfigGlobal("agentSystemPrompt"),
getConfigGlobal("agentDefaultModelId"),
getConfigGlobal("agentTitleModelId"),
getConfigGlobal("agentPublicToolSlugs"),
]);
const systemModels = await listSystemModels();
return R.success({
systemPrompt,
defaultModelId,
titleModelId,
publicToolSlugs: publicToolSlugs ?? [],
systemModels: systemModels.map((m) => ({
id: m.id,
name: m.name,
modelId: m.modelId,
type: m.type,
})),
});
});