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
ef47fcf7
Commit
ef47fcf7
authored
Oct 25, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:回答出现null
parent
564e78e3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+7
-3
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
ef47fcf7
...
@@ -131,7 +131,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -131,7 +131,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
systemMessage
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
SYSTEM
);
systemMessage
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
SYSTEM
);
Message
message
=
new
Message
();
Message
message
=
new
Message
();
message
.
setContent
(
"{"
+
input
+
"}"
);
message
.
setContent
(
"{"
+
input
+
"}"
);
message
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
USER
);
message
.
setRole
(
AgentApplicationDialoguesRecordConstants
.
ROLE
.
USER
);
List
<
Message
>
messages
=
new
ArrayList
<
Message
>()
{{
List
<
Message
>
messages
=
new
ArrayList
<
Message
>()
{{
add
(
systemMessage
);
add
(
systemMessage
);
...
@@ -396,7 +396,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -396,7 +396,7 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
if
(
LargeModelFunctionEnum
.
set_long_memory
.
name
().
equals
(
name
))
{
if
(
LargeModelFunctionEnum
.
set_long_memory
.
name
().
equals
(
name
))
{
List
<
LongMemoryEntity
>
longMemoryEntities
=
GetLongMemory
.
get
(
identifier
);
List
<
LongMemoryEntity
>
longMemoryEntities
=
GetLongMemory
.
get
(
identifier
);
if
(
CollectionUtils
.
isNotEmpty
(
longMemoryEntities
))
{
if
(
CollectionUtils
.
isNotEmpty
(
longMemoryEntities
))
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
""
);
for
(
LongMemoryEntity
longMemoryEntity
:
longMemoryEntities
)
{
for
(
LongMemoryEntity
longMemoryEntity
:
longMemoryEntities
)
{
stringBuilder
stringBuilder
.
append
(
"Time"
).
append
(
":"
).
append
(
longMemoryEntity
.
getTimestamp
())
.
append
(
"Time"
).
append
(
":"
).
append
(
longMemoryEntity
.
getTimestamp
())
...
@@ -407,12 +407,14 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -407,12 +407,14 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
String
searchMemoryContent
=
stringBuilder
.
toString
();
String
searchMemoryContent
=
stringBuilder
.
toString
();
promptTemplate
=
promptTemplate
.
replace
(
"${longMemoryResult}"
,
searchMemoryContent
);
promptTemplate
=
promptTemplate
.
replace
(
"${longMemoryResult}"
,
searchMemoryContent
);
}
}
}
else
{
promptTemplate
=
promptTemplate
.
replace
(
"${longMemoryResult}"
,
StringUtils
.
EMPTY
);
}
}
// 变量
// 变量
if
(
LargeModelFunctionEnum
.
set_value_memory
.
name
().
equals
(
name
))
{
if
(
LargeModelFunctionEnum
.
set_value_memory
.
name
().
equals
(
name
))
{
Map
<
Object
,
Object
>
map
=
GetValueMemory
.
get
(
identifier
);
Map
<
Object
,
Object
>
map
=
GetValueMemory
.
get
(
identifier
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
StringBuilder
stringBuilder
=
new
StringBuilder
(
""
);
if
(
MapUtils
.
isNotEmpty
(
map
))
{
if
(
MapUtils
.
isNotEmpty
(
map
))
{
Set
<
Object
>
keySet
=
map
.
keySet
();
Set
<
Object
>
keySet
=
map
.
keySet
();
for
(
Object
key
:
keySet
)
{
for
(
Object
key
:
keySet
)
{
...
@@ -420,6 +422,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
...
@@ -420,6 +422,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
}
}
}
}
promptTemplate
=
promptTemplate
.
replace
(
"${valueMemoryResult}"
,
stringBuilder
.
toString
());
promptTemplate
=
promptTemplate
.
replace
(
"${valueMemoryResult}"
,
stringBuilder
.
toString
());
}
else
{
promptTemplate
=
promptTemplate
.
replace
(
"${valueMemoryResult}"
,
StringUtils
.
EMPTY
);
}
}
}
}
...
...
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