Toggle navigation
Toggle navigation
This project
Loading...
Sign in
冯杨
/
liveTalking
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
冯杨
2025-04-29 17:32:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f014e7f7c8c92a32843a841945b290d8bf7852d1
f014e7f7
1 parent
8d25ce3c
同步github官方更新截止Commits on Apr 18, 2025
a9c36c76e569107b5a39b3de8afd6e016b24d662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
web/dashboard.html
web/dashboard.html
View file @
f014e7f
...
...
@@ -581,19 +581,46 @@
console
.
log
(
'Sending chat message:'
,
message
);
fetch
(
'/human'
,
{
body
:
JSON
.
stringify
({
text
:
message
,
type
:
'chat'
,
interrupt
:
true
,
sessionid
:
parseInt
(
document
.
getElementById
(
'sessionid'
).
value
),
}),
// fetch('/human', {
// body: JSON.stringify({
// text: message,
// type: 'chat',
// interrupt: true,
// sessionid: parseInt(document.getElementById('sessionid').value),
// }),
// headers: {
// 'Content-Type': 'application/json'
// },
// method: 'POST'
// });
var
payload
=
{
"model"
:
"fay-streaming"
,
"messages"
:
[
{
"role"
:
$
(
'#username'
).
val
(),
"content"
:
message
}
],
"observation"
:
""
};
fetch
(
'http://127.0.0.1:5000/v1/chat/completions'
,
{
body
:
JSON
.
stringify
(
payload
),
headers
:
{
'Content-Type'
:
'application/json'
'Content-Type'
:
'application/json'
},
method
:
'POST'
}).
then
(
function
(
response
)
{
if
(
response
.
ok
)
{
console
.
log
(
'Message sent to API.'
);
}
else
{
console
.
error
(
'Failed to send message to API.'
);
}
}).
catch
(
function
(
error
)
{
console
.
error
(
'Error:'
,
error
);
});
addChatMessage
(
message
,
'user'
);
$
(
'#chat-message'
).
val
(
''
);
});
...
...
Please
register
or
login
to post a comment