Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
robot-trans-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
robot-trans-platform
Commits
854af735
Commit
854af735
authored
Mar 20, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置文件
parent
6b8fd9bc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
8 deletions
+1
-8
robot-trans-manager/src/main/java/com/mortals/xhx/thread/ChatMsgRspThread.java
...rc/main/java/com/mortals/xhx/thread/ChatMsgRspThread.java
+0
-5
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/factory/FlowChatSubscriber.java
...a/com/mortals/xhx/webflux/factory/FlowChatSubscriber.java
+1
-1
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/service/impl/BaseChatService.java
...com/mortals/xhx/webflux/service/impl/BaseChatService.java
+0
-2
No files found.
robot-trans-manager/src/main/java/com/mortals/xhx/thread/ChatMsgRspThread.java
View file @
854af735
...
@@ -29,16 +29,12 @@ public class ChatMsgRspThread implements Runnable {
...
@@ -29,16 +29,12 @@ public class ChatMsgRspThread implements Runnable {
@Override
@Override
public
void
run
()
{
public
void
run
()
{
log
.
info
(
"快速响应线程开始,msgId:{}"
,
context
.
getMsgId
());
log
.
info
(
"快速响应线程开始,msgId:{}"
,
context
.
getMsgId
());
StringBuilder
answer
=
context
.
getAnswer
();
StringBuilder
answer
=
context
.
getAnswer
();
int
reCount
=
0
;
int
reCount
=
0
;
while
(
reCount
<
MAX_RETRY_COUNT
)
{
while
(
reCount
<
MAX_RETRY_COUNT
)
{
if
(!
answer
.
toString
().
isEmpty
())
{
if
(!
answer
.
toString
().
isEmpty
())
{
log
.
info
(
"快速响应线程结束 answer:{}"
,
answer
);
log
.
info
(
"快速响应线程结束 answer:{}"
,
answer
);
break
;
break
;
}
}
//创建一个初始化的answer
//创建一个初始化的answer
...
@@ -55,7 +51,6 @@ public class ChatMsgRspThread implements Runnable {
...
@@ -55,7 +51,6 @@ public class ChatMsgRspThread implements Runnable {
if
(
reCount
==
0
){
if
(
reCount
==
0
){
delta
.
put
(
"role"
,
"assistant"
);
delta
.
put
(
"role"
,
"assistant"
);
}
}
delta
.
put
(
"content"
,
""
);
delta
.
put
(
"content"
,
""
);
obj
.
put
(
"delta"
,
delta
);
obj
.
put
(
"delta"
,
delta
);
...
...
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/factory/FlowChatSubscriber.java
View file @
854af735
...
@@ -63,7 +63,7 @@ public class FlowChatSubscriber implements Subscriber<String>, Disposable {
...
@@ -63,7 +63,7 @@ public class FlowChatSubscriber implements Subscriber<String>, Disposable {
if
(
ObjectUtils
.
isEmpty
(
rsp
))
{
if
(
ObjectUtils
.
isEmpty
(
rsp
))
{
this
.
stopFlag
=
true
;
this
.
stopFlag
=
true
;
}
}
//
log.info(" onNext rsp:{}", rsp);
log
.
info
(
" onNext rsp:{}"
,
rsp
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"流式问答异常:{}"
,
e
.
getMessage
());
log
.
error
(
"流式问答异常:{}"
,
e
.
getMessage
());
}
finally
{
}
finally
{
...
...
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/service/impl/BaseChatService.java
View file @
854af735
...
@@ -51,7 +51,6 @@ public class BaseChatService extends AbstractFlowChatTemplate {
...
@@ -51,7 +51,6 @@ public class BaseChatService extends AbstractFlowChatTemplate {
@Override
@Override
public
String
onNext
(
String
data
,
FlowChatContext
context
)
{
public
String
onNext
(
String
data
,
FlowChatContext
context
)
{
if
(
StrUtil
.
equals
(
"[DONE]"
,
data
))
{
//[DONE]是消息结束标识
if
(
StrUtil
.
equals
(
"[DONE]"
,
data
))
{
//[DONE]是消息结束标识
return
null
;
return
null
;
}
}
...
@@ -60,7 +59,6 @@ public class BaseChatService extends AbstractFlowChatTemplate {
...
@@ -60,7 +59,6 @@ public class BaseChatService extends AbstractFlowChatTemplate {
if
(
bodyJson
==
null
)
{
if
(
bodyJson
==
null
)
{
return
data
;
return
data
;
}
}
/*if(ObjectUtils.isEmpty(context.getAnswer())){
/*if(ObjectUtils.isEmpty(context.getAnswer())){
//创建一个初始化的answer
//创建一个初始化的answer
JSONObject rspJson = new JSONObject();
JSONObject rspJson = new JSONObject();
...
...
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