chore: initialize wygj monorepo
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type CaseTag = {
|
||||
text: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type CaseSummaryItem = {
|
||||
label: string;
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type CaseRecord = {
|
||||
title: string;
|
||||
type: string;
|
||||
status: string;
|
||||
time: string;
|
||||
owner: string;
|
||||
summary: string;
|
||||
};
|
||||
|
||||
export type CaseUploadResponse = {
|
||||
caseId: string;
|
||||
fileName: string;
|
||||
transcript: string;
|
||||
tags: CaseTag[];
|
||||
};
|
||||
|
||||
export type CaseOrganizeResponse = {
|
||||
caseId: string;
|
||||
summary: CaseSummaryItem[];
|
||||
tags: CaseTag[];
|
||||
aiSummary: string;
|
||||
};
|
||||
|
||||
export type CaseCurateResponse = {
|
||||
selectedCaseIds: string[];
|
||||
records: CaseRecord[];
|
||||
sampleHint: string;
|
||||
};
|
||||
|
||||
export function uploadCaseAudio(data: { fileName: string; projectExtOrgId: string }): Promise<ApiResult<CaseUploadResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/case/upload',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function organizeKnowledgeCase(data: { caseId: string }): Promise<ApiResult<CaseOrganizeResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/case/organize',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function curateKnowledgeCase(data: { caseId: string; criteria: string; limit: number }): Promise<ApiResult<CaseCurateResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/case/curate',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type InterviewStartRequest = {
|
||||
candidateId: string;
|
||||
positionCode: string;
|
||||
mode: string;
|
||||
};
|
||||
|
||||
export type InterviewQuestionResponse = {
|
||||
questionId: string;
|
||||
seq: number;
|
||||
questionText: string;
|
||||
point: string;
|
||||
scenario: string;
|
||||
sampleAnswer: string;
|
||||
};
|
||||
|
||||
export type InterviewStartResponse = {
|
||||
sessionId: string;
|
||||
candidateId: string;
|
||||
candidateName: string;
|
||||
positionCode: string;
|
||||
questions: InterviewQuestionResponse[];
|
||||
};
|
||||
|
||||
export type InterviewAnswerRequest = {
|
||||
sessionId: string;
|
||||
questionId: string;
|
||||
answerText?: string;
|
||||
answerAudioUrl?: string;
|
||||
};
|
||||
|
||||
export type InterviewAnswerResponse = {
|
||||
score: number;
|
||||
dimensions: Record<string, number>;
|
||||
aiComment: string;
|
||||
};
|
||||
|
||||
export type InterviewFinishRequest = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
export type InterviewFinishResponse = {
|
||||
totalScore: number;
|
||||
suggestion: string;
|
||||
result: string;
|
||||
aiSummary: string;
|
||||
evidence: string;
|
||||
dimensions: Array<{
|
||||
label: string;
|
||||
value: number | string;
|
||||
note: string;
|
||||
}>;
|
||||
records: Array<{
|
||||
time: string;
|
||||
candidate: string;
|
||||
position: string;
|
||||
score: number;
|
||||
result: string;
|
||||
summary: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export function startInterview(data: InterviewStartRequest): Promise<ApiResult<InterviewStartResponse>> {
|
||||
return request({
|
||||
url: '/api/recruit/interview/start',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function submitInterviewAnswer(data: InterviewAnswerRequest): Promise<ApiResult<InterviewAnswerResponse>> {
|
||||
return request({
|
||||
url: '/api/recruit/interview/answer',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function finishInterview(data: InterviewFinishRequest): Promise<ApiResult<InterviewFinishResponse>> {
|
||||
return request({
|
||||
url: '/api/recruit/interview/finish',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type ModelProvider = {
|
||||
id: number;
|
||||
providerName: string;
|
||||
providerCode: string;
|
||||
providerDesc?: string;
|
||||
apiHost: string;
|
||||
status: string;
|
||||
sortOrder: number;
|
||||
source: string;
|
||||
configured: boolean;
|
||||
};
|
||||
|
||||
export type ModelConfig = {
|
||||
id: number;
|
||||
category: 'chat' | 'vector' | 'rerank' | string;
|
||||
modelName: string;
|
||||
providerCode: string;
|
||||
modelDescribe: string;
|
||||
modelDimension?: number;
|
||||
modelShow: string;
|
||||
apiHost?: string;
|
||||
enabled: boolean;
|
||||
apiKeyConfigured: boolean;
|
||||
configured: boolean;
|
||||
};
|
||||
|
||||
export type ModelProviderPayload = {
|
||||
providerName: string;
|
||||
providerCode: string;
|
||||
providerDesc?: string;
|
||||
apiHost?: string;
|
||||
apiKey?: string;
|
||||
status: string;
|
||||
sortOrder?: number;
|
||||
};
|
||||
|
||||
export type ModelConfigPayload = {
|
||||
category: string;
|
||||
modelName: string;
|
||||
providerCode: string;
|
||||
modelDescribe?: string;
|
||||
modelDimension?: number;
|
||||
modelShow: string;
|
||||
apiHost?: string;
|
||||
apiKey?: string;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
export type ModelChatResponse = {
|
||||
configured: boolean;
|
||||
providerCode: string;
|
||||
modelName: string;
|
||||
answer: string;
|
||||
mode: string;
|
||||
error?: string;
|
||||
hints: string[];
|
||||
};
|
||||
|
||||
export function getModelProviders(): Promise<ApiResult<ModelProvider[]>> {
|
||||
return request({
|
||||
url: '/api/aihr/model/providers',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function createModelProvider(data: ModelProviderPayload): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: '/api/aihr/model/providers',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function updateModelProvider(providerCode: string, data: ModelProviderPayload): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/aihr/model/providers/${providerCode}`,
|
||||
method: 'put',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function updateModelProviderStatus(providerCode: string, status: string): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/aihr/model/providers/${providerCode}/status`,
|
||||
method: 'patch',
|
||||
data: { status },
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function getModelConfigs(): Promise<ApiResult<ModelConfig[]>> {
|
||||
return request({
|
||||
url: '/api/aihr/model/configs',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function createModelConfig(data: ModelConfigPayload): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: '/api/aihr/model/configs',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function updateModelConfig(id: number, data: ModelConfigPayload): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/aihr/model/configs/${id}`,
|
||||
method: 'put',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function updateModelConfigEnabled(id: number, enabled: boolean): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/aihr/model/configs/${id}/enabled`,
|
||||
method: 'patch',
|
||||
data: { enabled },
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function testModelChat(data: { prompt: string; model?: string }): Promise<ApiResult<ModelChatResponse>> {
|
||||
return request({
|
||||
url: '/api/aihr/model/chat',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type PracticeStartRequest = {
|
||||
extPartyId: string;
|
||||
scenarioId: string;
|
||||
mode: string;
|
||||
};
|
||||
|
||||
export type PracticeStartResponse = {
|
||||
sessionId: string;
|
||||
scenarioId: string;
|
||||
scenarioName: string;
|
||||
trainee: string;
|
||||
customerText: string;
|
||||
emotion: number;
|
||||
trust: number;
|
||||
customerAudioUrl: string;
|
||||
persona: {
|
||||
customer: string;
|
||||
project: string;
|
||||
strategy: string;
|
||||
goal: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type PracticeTurnRequest = {
|
||||
sessionId: string;
|
||||
roundIndex: number;
|
||||
traineeText: string;
|
||||
traineeAudioUrl?: string;
|
||||
};
|
||||
|
||||
export type PracticeTurnResponse = {
|
||||
customerText: string;
|
||||
customerAudioUrl: string;
|
||||
emotion: number;
|
||||
trust: number;
|
||||
coachHint: string;
|
||||
roundIndex: number;
|
||||
finished: boolean;
|
||||
};
|
||||
|
||||
export type PracticeFinishRequest = {
|
||||
sessionId: string;
|
||||
};
|
||||
|
||||
export type PracticeFinishResponse = {
|
||||
totalScore: number;
|
||||
score: Array<{
|
||||
label: string;
|
||||
value: number | string;
|
||||
note: string;
|
||||
}>;
|
||||
mentorRewrite: string;
|
||||
aiComment: string;
|
||||
trustCurve: number[];
|
||||
records: Array<{
|
||||
time: string;
|
||||
trainee: string;
|
||||
scene: string;
|
||||
score: number;
|
||||
status: string;
|
||||
summary: string;
|
||||
}>;
|
||||
};
|
||||
|
||||
export function startPracticeSession(data: PracticeStartRequest): Promise<ApiResult<PracticeStartResponse>> {
|
||||
return request({
|
||||
url: '/api/train/practice/start',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function submitPracticeTurn(data: PracticeTurnRequest): Promise<ApiResult<PracticeTurnResponse>> {
|
||||
return request({
|
||||
url: '/api/train/practice/turn',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function finishPracticeSession(data: PracticeFinishRequest): Promise<ApiResult<PracticeFinishResponse>> {
|
||||
return request({
|
||||
url: '/api/train/practice/finish',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type ProcessingMetric = {
|
||||
key: string;
|
||||
label: string;
|
||||
value: string;
|
||||
note: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type ProcessingCategory = {
|
||||
name: string;
|
||||
files: number;
|
||||
size: string;
|
||||
icon: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type ProcessingTask = {
|
||||
id: number;
|
||||
category: string;
|
||||
fileName: string;
|
||||
fileType: string;
|
||||
size: string;
|
||||
status: string;
|
||||
statusType: string;
|
||||
progress: number;
|
||||
fragments: number;
|
||||
vectorStatus: string;
|
||||
vectorType: string;
|
||||
updatedAt: string;
|
||||
action: string;
|
||||
remark: string;
|
||||
summary: string;
|
||||
tags: string[];
|
||||
classifyReason: string;
|
||||
};
|
||||
|
||||
export type PipelineStep = {
|
||||
name: string;
|
||||
value: string;
|
||||
status: string;
|
||||
};
|
||||
|
||||
export type ProcessingEvent = {
|
||||
time: string;
|
||||
taskNo: string;
|
||||
fileName: string;
|
||||
event: string;
|
||||
result: string;
|
||||
resultType: string;
|
||||
detail: string;
|
||||
};
|
||||
|
||||
export type ProcessingRules = {
|
||||
parserEnabled: boolean;
|
||||
imageOcrEnabled: boolean;
|
||||
lowConfidenceRefusal: boolean;
|
||||
citationRequired: boolean;
|
||||
failedTasks: number;
|
||||
};
|
||||
|
||||
export type ProcessingOverview = {
|
||||
metrics: ProcessingMetric[];
|
||||
categories: ProcessingCategory[];
|
||||
tasks: ProcessingTask[];
|
||||
pipeline: PipelineStep[];
|
||||
events: ProcessingEvent[];
|
||||
rules: ProcessingRules;
|
||||
};
|
||||
|
||||
export type LocalImportRequest = {
|
||||
directory: string;
|
||||
category: string;
|
||||
limit?: number;
|
||||
};
|
||||
|
||||
export type LocalImportResponse = {
|
||||
root: string;
|
||||
directory: string;
|
||||
category: string;
|
||||
discovered: number;
|
||||
imported: number;
|
||||
failed: number;
|
||||
};
|
||||
|
||||
export type LocalImportTask = {
|
||||
id: number;
|
||||
directory: string;
|
||||
category: string;
|
||||
status: string;
|
||||
statusType: string;
|
||||
progress: number;
|
||||
totalFiles: number;
|
||||
importedFiles: number;
|
||||
failedFiles: number;
|
||||
currentFile: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
remark: string;
|
||||
};
|
||||
|
||||
export function getProcessingOverview(): Promise<ApiResult<ProcessingOverview>> {
|
||||
return request({
|
||||
url: '/api/knowledge/processing/overview',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function importLocalKnowledgeDocs(data: LocalImportRequest): Promise<ApiResult<LocalImportResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/doc/import-local',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function startLocalKnowledgeImportTask(data: LocalImportRequest): Promise<ApiResult<LocalImportTask>> {
|
||||
return request({
|
||||
url: '/api/knowledge/doc/import-local-task',
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function listLocalKnowledgeImportTasks(): Promise<ApiResult<LocalImportTask[]>> {
|
||||
return request({
|
||||
url: '/api/knowledge/doc/import-tasks',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = {
|
||||
code: number;
|
||||
msg: string;
|
||||
data: T;
|
||||
};
|
||||
|
||||
export type SopDoc = {
|
||||
title: string;
|
||||
desc: string;
|
||||
hit: string;
|
||||
type: string;
|
||||
};
|
||||
|
||||
export type SopSnippet = {
|
||||
title: string;
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type SopRecord = {
|
||||
title: string;
|
||||
category: string;
|
||||
version: string;
|
||||
status: string;
|
||||
owner: string;
|
||||
summary: string;
|
||||
};
|
||||
|
||||
export type SopSearchResponse = {
|
||||
queryText: string;
|
||||
category: string;
|
||||
answer: string;
|
||||
reference: string;
|
||||
docs: SopDoc[];
|
||||
snippets: SopSnippet[];
|
||||
training: string[];
|
||||
records: SopRecord[];
|
||||
};
|
||||
|
||||
export type SopUploadResponse = {
|
||||
docId: string;
|
||||
ossId: number;
|
||||
fileName: string;
|
||||
category: string;
|
||||
fragments: number;
|
||||
summary: string;
|
||||
tags: string[];
|
||||
snippets: SopSnippet[];
|
||||
};
|
||||
|
||||
export function searchKnowledgeSop(data: { queryText: string; category: string; limit: number }): Promise<ApiResult<SopSearchResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/search',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadKnowledgeDoc(data: FormData): Promise<ApiResult<SopUploadResponse>> {
|
||||
return request({
|
||||
url: '/api/knowledge/doc/upload',
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user