Commit 325d1649 authored by youxiaoji's avatar youxiaoji

+ [增加申请信息保存和提交的功能]

parent 15abfea8
......@@ -185,7 +185,7 @@ public class DefaultReactExecutor implements ReactExecutor {
memoryService.getHistoryMessages(sessionId, historyLength);
// 添加历史消息到Prompt
// messages.addAll(historyMessages);
messages.addAll(historyMessages);
// 将当前用户消息添加到内存中,以便下次对话使用
memoryService.addUserMessageToMemory(sessionId, userInput);
......
......@@ -5,7 +5,9 @@ import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import pangea.hiagent.tool.impl.HisenseTripTool;
import pangea.hiagent.tool.impl.VisitorAppointmentTool;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
......@@ -29,7 +31,7 @@ public class InfoCollectorService {
}
public void saveValue(String key, Object value) {
log.info("key {} value {}",key,value);
log.info("key {} value {}", key, value);
values.put(key, value);
}
......@@ -37,11 +39,27 @@ public class InfoCollectorService {
return values.get(key);
}
public Set<String> findLackInfo() {
public Set<String> findLackInfo(String pageId) {
Set<String> valueKeys = values.keySet();
Set<String> allKeys = infos.get(HisenseTripTool.pageId).stream().map(t -> ((JSONObject) t).getString("field_name")).collect(Collectors.toSet());
log.info("value keys {}", valueKeys);
Set<String> allKeys = infos.get(pageId).stream().map(t -> ((JSONObject) t).getString("code")).collect(Collectors.toSet());
log.info("all keys {}", allKeys);
allKeys.removeAll(valueKeys);
log.info("lack keys {}", allKeys);
return allKeys;
Set<String> lackInfos = new HashSet<>();
if(lackInfos.isEmpty()){
log.info("info is good enough");
return lackInfos;
}
infos.get(pageId).stream().forEach(t ->
{
JSONObject info = (JSONObject) t;
String code = info.getString("code");
if (allKeys.contains(code)) {
lackInfos.add(info.getString("field_name"));
}
});
log.info("lack infos {}", lackInfos);
return lackInfos;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment