feat(aihr): close phase two practice pilot gates
This commit is contained in:
@@ -12,6 +12,43 @@ export type PracticeStartRequest = {
|
||||
mode: string;
|
||||
};
|
||||
|
||||
export type PracticeScenarioResponse = {
|
||||
id: string;
|
||||
name: string;
|
||||
position: string;
|
||||
scenarioType: string;
|
||||
projectType: string;
|
||||
difficulty: number;
|
||||
customerPersona: string;
|
||||
openingText: string;
|
||||
explicitNeed: string;
|
||||
hiddenNeed: string;
|
||||
irritants: string;
|
||||
delights: string;
|
||||
sopRefs: string;
|
||||
successCriteria: string;
|
||||
strategy: string;
|
||||
goal: string;
|
||||
enabled: boolean;
|
||||
rubric?: {
|
||||
code: string;
|
||||
name: string;
|
||||
version: string;
|
||||
dimensions: Array<{ code: string; name: string; weight: number; description: string }>;
|
||||
};
|
||||
};
|
||||
|
||||
export type PracticeScenarioEnabledRequest = {
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
export type PracticePrepCardResponse = {
|
||||
keyPoints: string[];
|
||||
redLines: string[];
|
||||
scripts: string[];
|
||||
promptVersion: string;
|
||||
};
|
||||
|
||||
export type PracticeStartResponse = {
|
||||
sessionId: string;
|
||||
scenarioId: string;
|
||||
@@ -34,6 +71,7 @@ export type PracticeTurnRequest = {
|
||||
roundIndex: number;
|
||||
traineeText: string;
|
||||
traineeAudioUrl?: string;
|
||||
traineeAudioOssId?: number;
|
||||
};
|
||||
|
||||
export type PracticeTurnResponse = {
|
||||
@@ -42,6 +80,7 @@ export type PracticeTurnResponse = {
|
||||
emotion: number;
|
||||
trust: number;
|
||||
coachHint: string;
|
||||
redFlag: boolean;
|
||||
roundIndex: number;
|
||||
finished: boolean;
|
||||
};
|
||||
@@ -70,6 +109,78 @@ export type PracticeFinishResponse = {
|
||||
}>;
|
||||
};
|
||||
|
||||
export type PracticeCalibrationRequest = {
|
||||
reviewer?: string;
|
||||
correctedTotal?: number;
|
||||
correctedCompliance?: number;
|
||||
correctedEmotion?: number;
|
||||
correctedCommunication?: number;
|
||||
correctedMarketing?: number;
|
||||
reason?: string;
|
||||
};
|
||||
|
||||
export type PracticeCalibrationResponse = {
|
||||
id: number;
|
||||
sessionId: string;
|
||||
originalScore: number;
|
||||
correctedScore: number;
|
||||
reviewer: string;
|
||||
reason: string;
|
||||
status: string;
|
||||
createTime: string;
|
||||
};
|
||||
|
||||
export type PromptTemplateResponse = {
|
||||
id: number;
|
||||
code: string;
|
||||
name: string;
|
||||
category: string;
|
||||
outputFormat: string;
|
||||
systemPrompt: string;
|
||||
template: string;
|
||||
variables: string;
|
||||
version: string;
|
||||
enabled: boolean;
|
||||
description: string;
|
||||
updateTime: string;
|
||||
};
|
||||
|
||||
export type PromptTemplateRequest = {
|
||||
code: string;
|
||||
name: string;
|
||||
category: string;
|
||||
outputFormat: string;
|
||||
systemPrompt: string;
|
||||
template: string;
|
||||
variables: string;
|
||||
version: string;
|
||||
enabled: boolean;
|
||||
description: string;
|
||||
};
|
||||
|
||||
export function listPracticeScenarios(params?: { position?: string; scenarioType?: string }): Promise<ApiResult<PracticeScenarioResponse[]>> {
|
||||
return request({
|
||||
url: '/api/train/practice/scenarios',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function updatePracticeScenarioEnabled(id: string, data: PracticeScenarioEnabledRequest): Promise<ApiResult<null>> {
|
||||
return request({
|
||||
url: `/api/train/practice/scenarios/${id}/enabled`,
|
||||
method: 'patch',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function getPracticePrepCard(id: string): Promise<ApiResult<PracticePrepCardResponse>> {
|
||||
return request({
|
||||
url: `/api/train/practice/scenarios/${id}/prep-card`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function startPracticeSession(data: PracticeStartRequest): Promise<ApiResult<PracticeStartResponse>> {
|
||||
return request({
|
||||
url: '/api/train/practice/start',
|
||||
@@ -96,3 +207,44 @@ export function finishPracticeSession(data: PracticeFinishRequest): Promise<ApiR
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function calibratePracticeSession(sessionId: string, data: PracticeCalibrationRequest): Promise<ApiResult<PracticeCalibrationResponse>> {
|
||||
return request({
|
||||
url: `/api/train/practice/sessions/${sessionId}/calibration`,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function exportPracticePilotCsv(): Promise<Blob> {
|
||||
return request({
|
||||
url: '/api/train/practice/export',
|
||||
method: 'get',
|
||||
responseType: 'blob'
|
||||
}) as unknown as Promise<Blob>;
|
||||
}
|
||||
|
||||
export function listPromptTemplates(params?: { category?: string; code?: string; enabled?: boolean }): Promise<ApiResult<PromptTemplateResponse[]>> {
|
||||
return request({
|
||||
url: '/api/aihr/prompt-templates',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function createPromptTemplate(data: PromptTemplateRequest): Promise<ApiResult<PromptTemplateResponse>> {
|
||||
return request({
|
||||
url: '/api/aihr/prompt-templates',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function updatePromptTemplate(id: number, data: PromptTemplateRequest): Promise<ApiResult<PromptTemplateResponse>> {
|
||||
return request({
|
||||
url: `/api/aihr/prompt-templates/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
@@ -36,6 +36,16 @@ export type SopSearchResponse = {
|
||||
snippets: SopSnippet[];
|
||||
training: string[];
|
||||
records: SopRecord[];
|
||||
keyPoints?: string[];
|
||||
cautions?: string[];
|
||||
reviewId?: number;
|
||||
};
|
||||
|
||||
export type SopReviewResponse = {
|
||||
id: number;
|
||||
usable: boolean | null;
|
||||
status: string;
|
||||
reviewedAt: string;
|
||||
};
|
||||
|
||||
export type SopUploadResponse = {
|
||||
@@ -49,7 +59,7 @@ export type SopUploadResponse = {
|
||||
snippets: SopSnippet[];
|
||||
};
|
||||
|
||||
export function searchKnowledgeSop(data: { queryText: string; category: string; limit: number }): Promise<ApiResult<SopSearchResponse>> {
|
||||
export function searchKnowledgeSop(data: { queryText: string; category: string; position?: string; source?: string; limit: number }): Promise<ApiResult<SopSearchResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/search',
|
||||
method: 'post',
|
||||
@@ -68,6 +78,15 @@ export function uploadKnowledgeDoc(data: FormData): Promise<ApiResult<SopUploadR
|
||||
});
|
||||
}
|
||||
|
||||
export function reviewKnowledgeSop(id: number, data: { usable: boolean; reviewer?: string; note?: string }): Promise<ApiResult<SopReviewResponse>> {
|
||||
return request({
|
||||
url: `/api/knowledge/reviews/${id}`,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export type UploadEnqueueResponse = {
|
||||
itemId: number;
|
||||
batchId: string;
|
||||
|
||||
Reference in New Issue
Block a user