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
446d8046
Commit
446d8046
authored
Jan 10, 2025
by
alex yao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:NPE
parent
0d69cf0a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
AgentApplicationInfoServiceImpl.java
...ation/aggregate/impl/AgentApplicationInfoServiceImpl.java
+8
-5
No files found.
src/main/java/cn/com/poc/agent_application/aggregate/impl/AgentApplicationInfoServiceImpl.java
View file @
446d8046
...
...
@@ -13,6 +13,7 @@ import cn.com.poc.common.constant.CommonConstant;
import
cn.com.poc.common.utils.Assert
;
import
cn.com.poc.common.utils.BlContext
;
import
cn.com.poc.common.utils.JsonUtils
;
import
cn.com.poc.knowledge.constant.KnowledgeConstant
;
import
cn.com.poc.knowledge.entity.BizKnowledgeDocumentEntity
;
import
cn.com.poc.knowledge.service.BizKnowledgeDocumentService
;
import
cn.com.poc.support.security.oauth.entity.UserBaseEntity
;
...
...
@@ -582,7 +583,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
List
<
String
>
knowledgeIds
=
new
ArrayList
<>();
for
(
Integer
kdId
:
kdIds
)
{
BizKnowledgeDocumentEntity
knowledgeDocumentEntity
=
bizKnowledgeDocumentService
.
get
(
kdId
);
if
(
null
==
knowledgeDocumentEntity
)
{
// 筛选训练完成的文档,否则跳过该文档
if
(
null
==
knowledgeDocumentEntity
&&
KnowledgeConstant
.
TrainStatus
.
COMPLETE
.
equals
(
knowledgeDocumentEntity
.
getTrainStatus
()))
{
continue
;
}
knowledgeIds
.
add
(
knowledgeDocumentEntity
.
getKnowledgeId
());
...
...
@@ -743,7 +745,8 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
if
(
StringUtils
.
isBlank
(
res
))
{
continue
;
}
LargeModelDemandResult
result
=
JsonUtils
.
deSerialize
(
res
.
replaceFirst
(
EVENT_STREAM_PREFIX
,
StringUtils
.
EMPTY
),
LargeModelDemandResult
.
class
);
res
=
StringUtils
.
replace
(
res
,
EVENT_STREAM_PREFIX
,
StringUtils
.
EMPTY
);
LargeModelDemandResult
result
=
JsonUtils
.
deSerialize
(
res
,
LargeModelDemandResult
.
class
);
if
(!
"0"
.
equals
(
result
.
getCode
()))
{
logger
.
error
(
"LLM Error,code:{}"
,
result
.
getCode
());
I18nMessageException
ex
=
new
I18nMessageException
(
"exception/call.failure"
);
...
...
@@ -754,13 +757,13 @@ public class AgentApplicationInfoServiceImpl implements AgentApplicationInfoServ
if
(
StringUtils
.
isNotBlank
(
result
.
getMessage
()))
{
output
.
append
(
result
.
getMessage
());
}
writer
.
write
(
res
+
"\n\n"
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
res
+
"\n\n"
);
writer
.
flush
();
}
writer
.
write
(
EVENT_STREAM_PREFIX
+
"[DONE]\n\n"
);
// 关闭资源
bufferedReader
.
close
(
);
writer
.
write
(
EVENT_STREAM_PREFIX
+
"[DONE]\n\n"
);
writer
.
close
();
bufferedReader
.
close
();
return
output
.
toString
();
}
...
...
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