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
0d69cf0a
Commit
0d69cf0a
authored
Jan 03, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:NPE
parent
2f4aa601
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
LongMemory.java
...y/resource/demand/ai/function/long_memory/LongMemory.java
+3
-3
No files found.
src/main/java/cn/com/poc/thirdparty/resource/demand/ai/function/long_memory/LongMemory.java
View file @
0d69cf0a
...
...
@@ -16,7 +16,7 @@ public class LongMemory {
RedisService
redisService
=
SpringUtils
.
getBean
(
RedisService
.
class
);
List
<
AgentLongMemoryEntity
>
result
=
new
ArrayList
<>();
// 查询用户相关信息(什么内容都可以)
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
identifier
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
()
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
identifier
;
Map
<
Object
,
Object
>
map
=
redisService
.
hmget
(
contentKey
);
Set
<
Object
>
keySet
=
map
.
keySet
();
...
...
@@ -37,7 +37,7 @@ public class LongMemory {
public
static
void
clean
(
String
agentId
)
{
RedisService
redisService
=
SpringUtils
.
getBean
(
RedisService
.
class
);
String
key
=
AgentApplicationTools
.
identifier
(
agentId
,
agentId
);
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
()
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
;
redisService
.
del
(
contentKey
);
}
...
...
@@ -50,7 +50,7 @@ public class LongMemory {
public
static
void
delByKey
(
String
agentId
,
String
item
)
{
RedisService
redisService
=
SpringUtils
.
getBean
(
RedisService
.
class
);
String
key
=
AgentApplicationTools
.
identifier
(
agentId
,
agentId
);
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
()
;
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
key
;
redisService
.
hdel
(
contentKey
,
item
);
}
}
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