Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
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
quanku
qk_backend
Commits
a0d72c86
Commit
a0d72c86
authored
Oct 30, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai对话接口修改
parent
b35cd810
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ImServiceImpl.java
...-api/src/main/java/com/wwdz/ch/wx/impl/ImServiceImpl.java
+1
-1
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
+1
-1
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/ChatApi.java
View file @
a0d72c86
...
...
@@ -25,6 +25,7 @@ public class ChatApi {
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"query"
,
question
);
map
.
put
(
"history"
,
null
);
map
.
put
(
"model_name"
,
"chatglm2-6b"
);
okHttpUtil
.
addParams
(
map
);
okHttpUtil
.
post
(
true
);
String
responseStr
=
okHttpUtil
.
async
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ImServiceImpl.java
View file @
a0d72c86
...
...
@@ -124,8 +124,8 @@ public class ImServiceImpl implements IMService {
logger
.
info
(
"=========== userid:{}, 提问ai的消息发送成功 =========="
,
dto
.
getFromAccount
());
if
(
dto
.
getMsgType
()
==
IMEnum
.
MsgTypeEnum
.
TIMTextElem
.
getCode
())
{
String
question
=
(
String
)
dto
.
getMsgContent
();
question
=
question
+
",请回答钱币相关的内容"
;
String
answer
=
chatApi
.
chatWithModel
(
question
);
// String answer = JsonUtils.getValueByPath(response, "response");
//将回答也发送给IM
SendChatMsgRequestDto
answerDto
=
new
SendChatMsgRequestDto
();
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/ChatApiTest.java
View file @
a0d72c86
...
...
@@ -53,7 +53,7 @@ public class ChatApiTest {
@Test
public
void
chatWithModel
()
{
String
question
=
"什么是站洋"
;
String
question
=
"什么是站洋
,请回答钱币相关的内容
"
;
chatApi
.
chatWithModel
(
question
);
}
...
...
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