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
564e78e3
Commit
564e78e3
authored
Oct 25, 2024
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:期望用户发送信息后就会生成历史记录,而不是等回答完才生成
parent
c65615be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
AgentApplicationServiceImpl.java
...oc/expose/aggregate/impl/AgentApplicationServiceImpl.java
+9
-8
No files found.
src/main/java/cn/com/poc/expose/aggregate/impl/AgentApplicationServiceImpl.java
View file @
564e78e3
...
@@ -93,7 +93,14 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -93,7 +93,14 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
//获取知识库配置
//获取知识库配置
List
<
Integer
>
kdIdList
=
knowledgeService
.
getKdIdsByKnowledgeInfoIds
(
infoEntity
.
getKnowledgeIds
());
List
<
Integer
>
kdIdList
=
knowledgeService
.
getKdIdsByKnowledgeInfoIds
(
infoEntity
.
getKnowledgeIds
());
// 记录输入时间戳
// 构造对话参数
List
<
Message
>
messages
=
buildMessages
(
dialogsId
,
agentId
,
userBaseEntity
.
getUserId
(),
input
);
//配置对话function
List
<
Tool
>
tools
=
buildMemoryConfig
(
infoEntity
);
// 保存用户输入记录
Long
inputTimestamp
=
System
.
currentTimeMillis
();
Long
inputTimestamp
=
System
.
currentTimeMillis
();
BizAgentApplicationDialoguesRecordEntity
inputRecord
=
new
BizAgentApplicationDialoguesRecordEntity
();
BizAgentApplicationDialoguesRecordEntity
inputRecord
=
new
BizAgentApplicationDialoguesRecordEntity
();
inputRecord
.
setAgentId
(
agentId
);
inputRecord
.
setAgentId
(
agentId
);
...
@@ -105,12 +112,6 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -105,12 +112,6 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
BizAgentApplicationDialoguesRecordEntity
saveRecord
=
bizAgentApplicationDialoguesRecordService
.
save
(
inputRecord
);
BizAgentApplicationDialoguesRecordEntity
saveRecord
=
bizAgentApplicationDialoguesRecordService
.
save
(
inputRecord
);
userRecordId
=
saveRecord
.
getId
();
userRecordId
=
saveRecord
.
getId
();
// 构造对话参数
List
<
Message
>
messages
=
buildMessages
(
dialogsId
,
agentId
,
userBaseEntity
.
getUserId
(),
input
);
//配置对话function
List
<
Tool
>
tools
=
buildMemoryConfig
(
infoEntity
);
// 记录输出时间戳
// 记录输出时间戳
BizAgentApplicationDialoguesRecordEntity
outputRecord
=
new
BizAgentApplicationDialoguesRecordEntity
();
BizAgentApplicationDialoguesRecordEntity
outputRecord
=
new
BizAgentApplicationDialoguesRecordEntity
();
...
@@ -129,7 +130,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
...
@@ -129,7 +130,7 @@ public class AgentApplicationServiceImpl implements AgentApplicationService {
outputRecord
.
setContent
(
output
);
outputRecord
.
setContent
(
output
);
bizAgentApplicationDialoguesRecordService
.
save
(
outputRecord
);
bizAgentApplicationDialoguesRecordService
.
save
(
outputRecord
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
if
(
userRecordId
!=
null
){
if
(
userRecordId
!=
null
)
{
bizAgentApplicationDialoguesRecordService
.
deletedById
(
userRecordId
);
bizAgentApplicationDialoguesRecordService
.
deletedById
(
userRecordId
);
}
}
}
}
...
...
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