fix(training-pdf-import): 修复培训试题PDF导入判断题解析
This commit is contained in:
1 parent
3a22df736e
commit
91758ef2b4
19 files changed
+1767
-12
No files matched your search
@@ -1,4 +1,4 @@
|
||||
/**
|
||||
/**
|
||||
* features/admin/api/admin.api.ts
|
||||
* 管理后台 HTTP API:用户、部门、Agent、权限、报表、企业微信、公告等。
|
||||
*/
|
||||
@@ -131,6 +131,27 @@ export const uploadAdminAgentGuideFile = async (file: File) => {
|
||||
}
|
||||
return response.json();
|
||||
};
|
||||
export const importAdminAgentTrainingQuestionBankFromPdf = (agentId: number, payload: { guide_id?: number | null }) =>
|
||||
requestJson<{
|
||||
guide_id: number;
|
||||
guide_file_name: string;
|
||||
parsed_count: number;
|
||||
skipped_question_numbers: number[];
|
||||
extraction_mode?: 'pdf_text' | 'ocr' | 'ocr_fallback';
|
||||
extraction_warnings?: string[];
|
||||
question_bank: Array<{
|
||||
id: string;
|
||||
type: 'single' | 'boolean';
|
||||
prompt: string;
|
||||
answer: string;
|
||||
explanation: string;
|
||||
options?: Array<{ id: string; label: string }>;
|
||||
}>;
|
||||
}>(`/api/admin/agents/${agentId}/training-question-bank/import-pdf`, {
|
||||
method: 'POST',
|
||||
...jsonAuth(),
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
export const testAdminAgent = (id: number) =>
|
||||
requestJson<any>(`/api/admin/agents/${id}/test`, { method: 'POST', ...auth() });
|
||||
export const saveAdminAgentPermissions = (agentId: number, userIds: number[]) =>
|
||||
|
||||
Reference in new issue
Block a user