Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
poc-api
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
poc
poc-api
Commits
271fb965
Commit
271fb965
authored
Feb 06, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:关闭Agent应用 长期记忆和结构化记忆的有效期
parent
844a579a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
SetLongMemoryFunction.java
...demand/ai/function/long_memory/SetLongMemoryFunction.java
+2
-2
MemoryVariableWriterFunction.java
.../memory_variable_writer/MemoryVariableWriterFunction.java
+1
-3
No files found.
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/long_memory/SetLongMemoryFunction.java
View file @
271fb965
...
@@ -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"
;
}
}
...
...
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/memory_variable_writer/MemoryVariableWriterFunction.java
View file @
271fb965
...
@@ -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"
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment