Commit 271fb965 authored by alex yao's avatar alex yao

feat:关闭Agent应用 长期记忆和结构化记忆的有效期

parent 844a579a
...@@ -31,7 +31,7 @@ public class SetLongMemoryFunction extends AbstractLargeModelFunction { ...@@ -31,7 +31,7 @@ public class SetLongMemoryFunction extends AbstractLargeModelFunction {
.parameters(new Parameters("object").addProperties("content", new Properties("string", "内容的详细说明"))) .parameters(new Parameters("object").addProperties("content", new Properties("string", "内容的详细说明")))
.build(); .build();
private final Long expireTime = 30 * 60 * 24L; // 30天有效期 // private final Long expireTime = 30 * 60 * 24L; // 30天有效期
@Resource @Resource
...@@ -56,7 +56,7 @@ public class SetLongMemoryFunction extends AbstractLargeModelFunction { ...@@ -56,7 +56,7 @@ public class SetLongMemoryFunction extends AbstractLargeModelFunction {
// 提取 content // 提取 content
String contents = jsonObject.getStr("content"); String contents = jsonObject.getStr("content");
String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key; String contentKey = SetLongMemoryConstants.REDIS_PREFIX + key;
redisService.hset(contentKey, DateUtils.getCurrTime(), contents, expireTime); redisService.hset(contentKey, DateUtils.getCurrTime(), contents);
return "SUCCESS"; return "SUCCESS";
} }
......
...@@ -65,9 +65,7 @@ public class MemoryVariableWriterFunction extends AbstractLargeModelFunction { ...@@ -65,9 +65,7 @@ public class MemoryVariableWriterFunction extends AbstractLargeModelFunction {
} else { } else {
setMap(new JSONObject(content), result); setMap(new JSONObject(content), result);
} }
// 30天有效期 redisService.hmset(contentKey, result);
long expireTime = 30 * 60 * 24L;
redisService.hmset(contentKey, result, expireTime);
return "SUCCESS"; return "SUCCESS";
} }
......
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