结束评分结果逻辑修改
This commit is contained in:
@@ -382,7 +382,7 @@ public class ChatWebSocketHandler {
|
|||||||
Map<String, String> mapEntity = list.get(0);
|
Map<String, String> mapEntity = list.get(0);
|
||||||
//更新问题记录
|
//更新问题记录
|
||||||
mapEntity.put("role", "system");
|
mapEntity.put("role", "system");
|
||||||
mapEntity.put("content", "You are a construction industry interview expert. Rate candidate responses on a 1-5 scale and analyze key signals.");
|
mapEntity.put("content", "You are a construction industry interview expert. Evaluate candidate responses and provide scores (1-5) and follow-up questions when needed. Always respond in JSON format.");
|
||||||
//每个回答的内容前面要加上候选人的职位
|
//每个回答的内容前面要加上候选人的职位
|
||||||
if (StrUtil.isNotEmpty(position)) {
|
if (StrUtil.isNotEmpty(position)) {
|
||||||
for (Map map : list) {
|
for (Map map : list) {
|
||||||
@@ -399,8 +399,14 @@ public class ChatWebSocketHandler {
|
|||||||
log.info("结束AI提示词为:{}", promptJson);
|
log.info("结束AI提示词为:{}", promptJson);
|
||||||
ChatGPTClient gptClient = SpringUtils.getBean(ChatGPTClient.class);
|
ChatGPTClient gptClient = SpringUtils.getBean(ChatGPTClient.class);
|
||||||
String resultMsg = gptClient.handleAiChat(promptJson, "QA");
|
String resultMsg = gptClient.handleAiChat(promptJson, "QA");
|
||||||
|
//开始解析返回结果
|
||||||
|
Map mapResultData = JSONUtil.toBean(resultMsg,Map.class);
|
||||||
|
//获取评分
|
||||||
|
Object scoreStr = mapResultData.get("score");
|
||||||
|
Object assessment = mapResultData.get("assessment");
|
||||||
|
|
||||||
Map<String, String> resultEntity = new HashMap<>();
|
Map<String, String> resultEntity = new HashMap<>();
|
||||||
resultEntity.put("content", resultMsg);
|
resultEntity.put("content", scoreStr +"\n"+assessment);
|
||||||
resultEntity.put("type", "score");
|
resultEntity.put("type", "score");
|
||||||
try{
|
try{
|
||||||
//返回最终的评分结构
|
//返回最终的评分结构
|
||||||
|
|||||||
Reference in New Issue
Block a user