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
c59469b9
Commit
c59469b9
authored
Nov 08, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 长期记忆倒叙
parent
06861450
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
AgentApplicationInfoRestImpl.java
...t_application/rest/impl/AgentApplicationInfoRestImpl.java
+6
-9
No files found.
src/main/java/cn/com/poc/agent_application/rest/impl/AgentApplicationInfoRestImpl.java
View file @
c59469b9
...
@@ -33,10 +33,7 @@ import javax.annotation.Resource;
...
@@ -33,10 +33,7 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.io.PrintWriter
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Component
@Component
...
@@ -310,12 +307,12 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -310,12 +307,12 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
}
}
@Override
@Override
public
List
<
String
>
createFeaturedQuestions
(
AgentApplicationGCDto
dto
){
public
List
<
String
>
createFeaturedQuestions
(
AgentApplicationGCDto
dto
)
{
return
agentApplicationInfoService
.
createFeaturedQuestions
(
dto
.
getAgentTitle
(),
dto
.
getAgentDesc
());
return
agentApplicationInfoService
.
createFeaturedQuestions
(
dto
.
getAgentTitle
(),
dto
.
getAgentDesc
());
}
}
@Override
@Override
public
String
createPreamble
(
AgentApplicationGCDto
dto
){
public
String
createPreamble
(
AgentApplicationGCDto
dto
)
{
return
agentApplicationInfoService
.
createPreamble
(
dto
.
getAgentTitle
(),
dto
.
getAgentDesc
(),
dto
.
getAgentSystem
());
return
agentApplicationInfoService
.
createPreamble
(
dto
.
getAgentTitle
(),
dto
.
getAgentDesc
(),
dto
.
getAgentSystem
());
}
}
...
@@ -374,7 +371,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -374,7 +371,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
}
}
@Override
@Override
public
List
<
AgentLongMemoryDto
>
getLongMemoryList
(
String
agentId
){
public
List
<
AgentLongMemoryDto
>
getLongMemoryList
(
String
agentId
)
{
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
agentId
);
List
<
AgentLongMemoryDto
>
result
=
new
ArrayList
<>();
List
<
AgentLongMemoryDto
>
result
=
new
ArrayList
<>();
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
...
@@ -387,7 +384,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -387,7 +384,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
entity
.
setTimestamp
(
mapKey
.
toString
());
entity
.
setTimestamp
(
mapKey
.
toString
());
result
.
add
(
entity
);
result
.
add
(
entity
);
}
}
return
result
;
return
result
.
stream
().
sorted
(
Comparator
.
comparing
(
AgentLongMemoryDto:
:
getTimestamp
).
reversed
()).
collect
(
Collectors
.
toList
())
;
}
}
@Override
@Override
...
@@ -399,7 +396,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
...
@@ -399,7 +396,7 @@ public class AgentApplicationInfoRestImpl implements AgentApplicationInfoRest {
}
}
@Override
@Override
public
void
deleteLongMemory
(
String
agentId
){
public
void
deleteLongMemory
(
String
agentId
)
{
Assert
.
notNull
(
agentId
);
Assert
.
notNull
(
agentId
);
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
String
contentKey
=
SetLongMemoryConstants
.
REDIS_PREFIX
+
agentId
+
":"
+
BlContext
.
getCurrentUserNotException
().
getUserId
().
toString
();
redisService
.
del
(
contentKey
);
redisService
.
del
(
contentKey
);
...
...
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