Commit e0282dc3 authored by youxiaoji's avatar youxiaoji

* [暂存函数发送数据时,如果字段存在值,将字段值一起返回]

* [提示词不再添加历史信息,将LLM当做无状态处理,信息由暂存接口保存处理]
parent 5eb0441b
......@@ -187,7 +187,7 @@ public class DefaultReactExecutor implements ReactExecutor {
memoryService.getHistoryMessages(sessionId, historyLength);
// 添加历史消息到Prompt
messages.addAll(historyMessages);
// messages.addAll(historyMessages);
// 将当前用户消息添加到内存中,以便下次对话使用
memoryService.addUserMessageToMemory(sessionId, userInput);
......
......@@ -142,12 +142,12 @@ public class VisitorAppointmentTool {
}
@Tool(description = "提交访客预约申请")
public String submitAppointmentApply(JSONObject jsonObject) {
public String submitAppointmentApply(ToolContext toolContext) {
sharedContext.tracing().start(new Tracing.StartOptions()
.setScreenshots(true)
.setSnapshots(true)
.setSources(true));
log.info("jsonObject = {}", jsonObject);
log.info("submit apply info ");
JSONArray jsonArray = infoCollectorService.getInfo(pageId);
long startTime = System.currentTimeMillis();
......@@ -175,7 +175,7 @@ public class VisitorAppointmentTool {
log.info("json {}", obj);
String fieldName = obj.getString("field_name");
String fieldValue = jsonObject.getString(obj.getString("code"));
String fieldValue = infoCollectorService.getValue(obj.getString("code")).toString();
if (fieldName.compareToIgnoreCase("访问园区") == 0) {
parkValue = fieldValue;
continue;
......@@ -209,7 +209,7 @@ public class VisitorAppointmentTool {
for (JSONObject tmp : dateJson) {
String fieldName = tmp.getString("field_name");
String fieldValue = jsonObject.getString(tmp.getString("code"));
String fieldValue = infoCollectorService.getValue(tmp.getString("code")).toString();
String[] values = fieldValue.split("-");
page.locator(".van-cell")
......@@ -279,8 +279,8 @@ public class VisitorAppointmentTool {
JSONArray lackJson = new JSONArray();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject tmp = jsonArray.getJSONObject(i);
if (keys.contains(tmp.getString("field_name"))) {
lackJson.add(tmp.getJSONObject("pangea_json"));
if(infoCollectorService.getValue(tmp.getString("code")) != null){
tmp.put("value", infoCollectorService.getValue(tmp.getString("code")).toString());
}
}
JSONObject formMessage = new JSONObject();
......@@ -289,7 +289,7 @@ public class VisitorAppointmentTool {
}
StringBuilder sb = new StringBuilder();
if (keys.isEmpty()) {
sb.append("用户已提交全部数据,提示用户提交申请");
sb.append("所有必需信息已收集,准备提交申请");
} else {
sb.append("用户还有以下信息未提交:");
sb.append("\n");
......
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