Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Skidn disease App
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
Skin disease
Skidn disease App
Commits
3b8104ad
Commit
3b8104ad
authored
Oct 16, 2021
by
Kavindu Randika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fixing 2
parent
ca4e7ca5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
app/src/main/java/com/project/skidn_disease_app/ChatFragment.java
...main/java/com/project/skidn_disease_app/ChatFragment.java
+12
-1
No files found.
app/src/main/java/com/project/skidn_disease_app/ChatFragment.java
View file @
3b8104ad
...
...
@@ -93,7 +93,8 @@ public class ChatFragment extends Fragment {
chatRvAdpater
.
notifyDataSetChanged
();
String
url
=
"http://10.0.2.2:8000/api/chatbot"
;
String
baseurl
=
"http://10.0.2.2:8000/api/chatbot"
;
String
quary
=
"{\n \"msg\": \"hi\"\n}"
;
String
userText
=
userEdittext
.
getText
().
toString
();
String
quary
=
"{\n \"msg\": \""
+
userText
+
"\"\n}"
;
JSONObject
jsonBody
=
new
JSONObject
(
quary
);
System
.
out
.
println
(
"here"
);
JsonObjectRequest
req
=
new
JsonObjectRequest
(
Request
.
Method
.
POST
,
url
,
jsonBody
,
new
Response
.
Listener
<
JSONObject
>()
{
...
...
@@ -103,6 +104,16 @@ public class ChatFragment extends Fragment {
System
.
out
.
println
(
response
);
try
{
String
bot_msg
=
(
String
)
response
.
get
(
"msg"
);
String
tag_1
=
"<pad>"
;
String
tag_2
=
"</s>"
;
if
(
bot_msg
.
contains
(
tag_1
)){
bot_msg
=
bot_msg
.
replaceAll
(
tag_1
,
""
);
}
if
(
bot_msg
.
contains
(
tag_2
)){
bot_msg
=
bot_msg
.
replaceAll
(
tag_2
,
""
);
}
System
.
out
.
println
(
bot_msg
);
chatModals
.
add
(
new
ChatModal
(
bot_msg
,
BOT_KEY
));
chatRvAdpater
.
notifyDataSetChanged
();
...
...
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