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
d77ca5b1
Commit
d77ca5b1
authored
Mar 13, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改配置文件
parent
123c324c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/service/impl/BaseChatService.java
...com/mortals/xhx/webflux/service/impl/BaseChatService.java
+9
-5
robot-trans-manager/src/test/java/TestRot.java
robot-trans-manager/src/test/java/TestRot.java
+2
-2
No files found.
robot-trans-manager/src/main/java/com/mortals/xhx/webflux/service/impl/BaseChatService.java
View file @
d77ca5b1
...
...
@@ -66,6 +66,7 @@ public class BaseChatService extends AbstractFlowChatTemplate {
JSONObject
rspJson
=
new
JSONObject
();
rspJson
.
put
(
"id"
,
context
.
getMsgId
());
rspJson
.
put
(
"created"
,
new
Date
().
getTime
());
rspJson
.
put
(
"model"
,
""
);
JSONArray
jsonArray
=
new
JSONArray
();
JSONObject
obj
=
new
JSONObject
();
...
...
@@ -74,13 +75,16 @@ public class BaseChatService extends AbstractFlowChatTemplate {
delta
.
put
(
"role"
,
"assistant"
);
delta
.
put
(
"content"
,
""
);
obj
.
put
(
"delta"
,
delta
);
obj
.
put
(
"index"
,
0
);
obj
.
put
(
"finish_reason"
,
"null"
);
jsonArray
.
add
(
obj
);
rspJson
.
put
(
"
delta
"
,
jsonArray
);
rspJson
.
put
(
"
index"
,
0
);
rspJson
.
put
(
"finish_reason"
,
null
);
rspJson
.
put
(
"
choices
"
,
jsonArray
);
rspJson
.
put
(
"
object"
,
""
);
num
++;
context
.
getEmitter
().
next
(
rspJson
.
toJSONString
());
}
/* String status = bodyJson.getString("status");
if ("running".equals(status)) {
...
...
@@ -122,7 +126,7 @@ public class BaseChatService extends AbstractFlowChatTemplate {
delta
.
put
(
"content"
,
""
);
this
.
num
=
0
;
}
else
{
delta
.
put
(
"finish_reason"
,
null
);
jsonObject
.
put
(
"finish_reason"
,
"null"
);
}
}
...
...
robot-trans-manager/src/test/java/TestRot.java
View file @
d77ca5b1
...
...
@@ -50,8 +50,8 @@ public class TestRot {
.
build
();
Request
request
=
new
Request
.
Builder
()
//
.url("http://localhost:18006/chat/base")
.
url
(
"http://robot.scsmile.cn/chat/base"
)
.
url
(
"http://localhost:18006/chat/base"
)
//
.url("http://robot.scsmile.cn/chat/base")
.
headers
(
headers
)
.
post
(
requestBody
)
.
build
();
...
...
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