Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
deep-ask
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
deepseek
deep-ask
Commits
0785404c
Commit
0785404c
authored
Feb 27, 2025
by
leiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、调整后台接收前端发送数据量
2、对调用进行json包装
parent
62de82cd
Pipeline
#6408
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
DeepSeekAiListener.java
src/main/java/admin/listener/DeepSeekAiListener.java
+9
-1
No files found.
src/main/java/admin/listener/DeepSeekAiListener.java
View file @
0785404c
...
...
@@ -4,6 +4,7 @@ package admin.listener;
import
admin.model.deepseek.resp.stream.ChatStreamResponse
;
import
admin.model.maxdb.resp.MaxdbStreamResponse
;
import
admin.service.TextToSpeechService
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.Gson
;
...
...
@@ -17,6 +18,8 @@ import okhttp3.sse.EventSourceListener;
import
javax.annotation.Resource
;
import
javax.websocket.Session
;
import
java.net.SocketException
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
/**
...
...
@@ -60,7 +63,12 @@ public class DeepSeekAiListener extends EventSourceListener {
if
(
completionResponse
.
getContent
()!=
null
){
System
.
out
.
print
(
completionResponse
.
getContent
());
this
.
stringBuffer
.
append
(
completionResponse
.
getContent
());
this
.
session
.
getBasicRemote
().
sendText
(
completionResponse
.
getContent
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"action"
,
"reply"
);
map
.
put
(
"type"
,
"text"
);
map
.
put
(
"content"
,
completionResponse
.
getContent
());
String
msg
=
JSON
.
toJSONString
(
map
);
this
.
session
.
getBasicRemote
().
sendText
(
msg
);
}
}
catch
(
Exception
e
){
System
.
out
.
println
(
e
.
getMessage
());
...
...
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