Merge branch 'dev' of https://github.com/Vetti-AI/Vetti-Service into dev
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
package com.vetti.hotake.domain.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 候选人面试综合评估 信息对象
|
||||
*
|
||||
* @author wangxiangshun
|
||||
* @date 2026-01-17
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class HotakeCandidateInterviewEvaluationVo {
|
||||
|
||||
@ApiModelProperty("岗位名称")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty("必备技能")
|
||||
private String requiredSkills;
|
||||
|
||||
@ApiModelProperty("首选技能")
|
||||
private String preferredSkills;
|
||||
|
||||
@ApiModelProperty("经验要求")
|
||||
private String experienceRequired;
|
||||
|
||||
@ApiModelProperty("候选者名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("当前岗位")
|
||||
private String currentPosition;
|
||||
|
||||
@ApiModelProperty("邮箱")
|
||||
private String email;
|
||||
|
||||
@ApiModelProperty("工作经验")
|
||||
private String workExperience;
|
||||
|
||||
@ApiModelProperty("技能")
|
||||
private String skills;
|
||||
|
||||
@ApiModelProperty("教育")
|
||||
private String education;
|
||||
|
||||
@ApiModelProperty("证书")
|
||||
private String certifications;
|
||||
|
||||
@ApiModelProperty("问题")
|
||||
private String questions;
|
||||
|
||||
@ApiModelProperty("答案")
|
||||
private String answers;
|
||||
|
||||
@ApiModelProperty("技术分数")
|
||||
private String technical;
|
||||
|
||||
@ApiModelProperty("沟通分数")
|
||||
private String communication;
|
||||
|
||||
@ApiModelProperty("安全意思分数")
|
||||
private String safetyAwareness;
|
||||
|
||||
@ApiModelProperty("解决问题分数")
|
||||
private String problemSolving;
|
||||
|
||||
|
||||
}
|
||||
@@ -151,4 +151,11 @@ public interface IHotakeAiCommonToolsService {
|
||||
*/
|
||||
public HotakeCandidateCompatibilityDto handleCandidateCompatibility(HotakeCandidateCompatibilityVo compatibilityVo);
|
||||
|
||||
/**
|
||||
* 候选人面试综合评估
|
||||
* @param evaluationVo 候选人面试综合评估 输入信息
|
||||
* @return
|
||||
*/
|
||||
public HotakeCandidateCompatibilityDto getCandidateInterviewEvaluation(HotakeCandidateInterviewEvaluationVo evaluationVo);
|
||||
|
||||
}
|
||||
|
||||
@@ -1336,4 +1336,86 @@ public class HotakeAiCommonToolsServiceImpl extends BaseServiceImpl implements I
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 候选人面试综合评估
|
||||
*
|
||||
* @param evaluationVo 候选人面试综合评估 输入信息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public HotakeCandidateCompatibilityDto getCandidateInterviewEvaluation(HotakeCandidateInterviewEvaluationVo evaluationVo) {
|
||||
HotakeCandidateCompatibilityDto dto = new HotakeCandidateCompatibilityDto();
|
||||
String prompt = AiCommonPromptConstants.initializationCandidateInterviewEvaluationPrompt();
|
||||
|
||||
String userPrompt_1 = "Job Posting:\n" +
|
||||
"Title: "+evaluationVo.getTitle()+"\n" +
|
||||
"Description: "+evaluationVo.getDescription()+"\n" +
|
||||
"Required Skills: ${jobPosting.required_skills.join(', ')}\n" +
|
||||
"Preferred Skills: ${jobPosting.preferred_skills.join(', ')}\n" +
|
||||
"Experience Required: ${jobPosting.experience_required}\n" +
|
||||
"\n" +
|
||||
"Candidate Information:\n" +
|
||||
"Name: ${candidate.name}\n" +
|
||||
"Current Position: ${candidate.current_position}\n" +
|
||||
"Email: ${candidate.email}\n" +
|
||||
"Work Experience: ${candidate.work_experience}\n" +
|
||||
"Skills: ${candidate.skills.join(', ')}\n" +
|
||||
"Education: ${candidate.education}\n" +
|
||||
"Certifications: ${candidate.certifications.join(', ')}\n" +
|
||||
"\n" +
|
||||
"${interviewData ? `Interview Data:\n" +
|
||||
"Questions: ${interviewData.questions.join('; ')}\n" +
|
||||
"Answers: ${interviewData.answers.join('; ')}\n" +
|
||||
"Scores: Technical=${interviewData.scores.technical}, Communication=${interviewData.scores.communication}, Safety Awareness=${interviewData.scores.safety_awareness}, Problem Solving=${interviewData.scores.problem_solving}` : ''}\n" +
|
||||
"\n" +
|
||||
"Please analyze this candidate and provide a comprehensive overview with Assessment, Rating, and Questions scores.";
|
||||
|
||||
//处理岗位信息补充
|
||||
List<Map<String, String>> listOne = new LinkedList();
|
||||
Map<String, String> mapEntityOne = new HashMap<>();
|
||||
mapEntityOne.put("role", "system");
|
||||
mapEntityOne.put("content", prompt);
|
||||
listOne.add(mapEntityOne);
|
||||
Map<String, String> mapUserEntityOne = new HashMap<>();
|
||||
mapUserEntityOne.put("role", "user");
|
||||
mapUserEntityOne.put("content", userPrompt_1);
|
||||
listOne.add(mapUserEntityOne);
|
||||
String promptJsonOne = JSONUtil.toJsonStr(listOne);
|
||||
String resultStrOne = chatGPTClient.handleAiChat(promptJsonOne, "AICAC");
|
||||
String resultJsonOne = resultStrOne.replaceAll("```json", "").replaceAll("```", "");
|
||||
log.info("候选人面试综合评估:{}", resultJsonOne);
|
||||
Map dataMap = JSONUtil.toBean(resultJsonOne, Map.class);
|
||||
if(ObjectUtil.isNotEmpty(dataMap.get("strengths_score"))){
|
||||
dto.setStrengthsScore(new BigDecimal(dataMap.get("strengths_score").toString()));
|
||||
}else{
|
||||
dto.setStrengthsScore(BigDecimal.ZERO);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(dataMap.get("differences_score"))){
|
||||
dto.setDifferencesScore(new BigDecimal(dataMap.get("differences_score").toString()));
|
||||
}else{
|
||||
dto.setDifferencesScore(BigDecimal.ZERO);
|
||||
}
|
||||
if(ObjectUtil.isNotEmpty(dataMap.get("cultural_score"))){
|
||||
dto.setCulturalScore(new BigDecimal(dataMap.get("cultural_score").toString()));
|
||||
}else{
|
||||
dto.setCulturalScore(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
List<String> strengths = (List<String>)dataMap.get("key_strengths");
|
||||
dto.setKeyStrengths(strengths);
|
||||
|
||||
List<String> differences = (List<String>)dataMap.get("key_differences");
|
||||
dto.setKeyDifferences(differences);
|
||||
|
||||
List<String> fitDetails = (List<String>)dataMap.get("cultural_fit_details");
|
||||
dto.setCulturalFitDetails(fitDetails);
|
||||
|
||||
BigDecimal overallScore = dto.getStrengthsScore().multiply(new BigDecimal(0.4)).
|
||||
add(dto.getDifferencesScore().multiply(new BigDecimal(0.3)).add(dto.getCulturalScore().multiply(new BigDecimal(0.3))));
|
||||
dto.setOverallScore(overallScore);
|
||||
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user