feat: 增加 Agent Excel 批量测试

This commit is contained in:
2026-08-12 17:00:50 +08:00
parent c4231f268b
commit 3faecab6ac
26 changed files with 1327 additions and 6 deletions

View File

@@ -8,6 +8,8 @@ import type {
AgentDebugStreamComplete,
AgentGenerationConfig,
AgentRuntimeConfig,
AgentBatchJob,
AgentBatchJobDetail,
AiLogRecord,
ApiResponse,
ChatDetail,
@@ -259,6 +261,19 @@ export const api = {
agentRuntimeConfig: () => request<AgentRuntimeConfig>("/admin/agent/runtime-config"),
saveAgentRuntimeConfig: (payload: AgentGenerationConfig) =>
request<AgentRuntimeConfig>("/admin/agent/runtime-config", { method: "PUT", body: JSON.stringify(payload) }),
downloadAgentBatchTemplate: () => download("/admin/agent/batch/template", "Agent批量测试导入模板.xlsx"),
createAgentBatch: (file: File, config: Record<string, unknown>) => {
const formData = new FormData();
formData.append("file", file);
formData.append("configJson", JSON.stringify(config));
return upload<AgentBatchJob>("/admin/agent/batch/jobs", formData);
},
agentBatchJobs: (query: { page?: number; pageSize?: number } = {}) =>
request<PageResult<AgentBatchJob>>(`/admin/agent/batch/jobs${queryString(query)}`),
agentBatchJob: (id: number, query: { page?: number; pageSize?: number } = {}) =>
request<AgentBatchJobDetail>(`/admin/agent/batch/jobs/${id}${queryString(query)}`),
exportAgentBatch: (id: number) => download(`/admin/agent/batch/jobs/${id}/export`, `Agent批量测试结果_${id}.xlsx`),
cancelAgentBatch: (id: number) => request<AgentBatchJob>(`/admin/agent/batch/jobs/${id}/cancel`, { method: "POST", body: "{}" }),
models: () => request<ModelItem[]>("/admin/model/list"),
createModel: (payload: Record<string, unknown>) =>
request<ModelItem>("/admin/model", { method: "POST", body: JSON.stringify(payload) }),