Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elleai
Project
Project
Details
Activity
Releases
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
ai-tech
E
ellehuis-group
backend
elleai
Commits
daf78dda
Commit
daf78dda
authored
Nov 29, 2024
by
陈立彬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix答案重复
parent
c8b7e1de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
AppExamineService.java
.../breeze/elleai/application/service/AppExamineService.java
+3
-3
No files found.
src/main/java/cn/breeze/elleai/application/service/AppExamineService.java
View file @
daf78dda
...
...
@@ -1579,7 +1579,7 @@ public class AppExamineService {
param
.
put
(
"conversation_id"
,
""
);
param
.
put
(
"user"
,
userId
);
final
String
Buffer
answerBuffer
=
new
StringBuffer
()
;
final
String
[]
standardAnswer
=
new
String
[
1
]
;
final
StringBuffer
replyBuffer
=
new
StringBuffer
();
final
String
[]
score
=
new
String
[
1
];
return
webClient
.
post
().
uri
(
"/chat-messages"
).
accept
(
MediaType
.
TEXT_EVENT_STREAM
).
bodyValue
(
param
.
toJSONString
()).
exchangeToFlux
(
r
->
r
.
bodyToFlux
(
String
.
class
))
...
...
@@ -1598,14 +1598,14 @@ public class AppExamineService {
Pattern
answerPattern
=
Pattern
.
compile
(
"\"answer\":\"([^\"]*)"
);
Matcher
answerMatcher
=
answerPattern
.
matcher
(
replyBuffer
.
toString
());
if
(
answerMatcher
.
find
())
{
answerBuffer
.
append
(
answerMatcher
.
group
(
1
)
);
standardAnswer
[
0
]
=
answerMatcher
.
group
(
1
);
}
}
SubmitAnswerStreamResultDto
result
=
new
SubmitAnswerStreamResultDto
();
if
(
StringUtils
.
isNotEmpty
(
score
[
0
]))
{
result
.
setScore
(
Float
.
valueOf
(
score
[
0
]));
}
result
.
setAnswer
(
answerBuffer
.
toString
()
);
result
.
setAnswer
(
standardAnswer
[
0
]
);
return
result
;
}).
doOnComplete
(
()
->
{
...
...
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