|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>WeChat-like Chat Interface</title>
|
|
|
|
|
<title>Artemis GPT</title>
|
|
|
|
|
<!-- Bootstrap CSS -->
|
|
|
|
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
</head>
|
|
|
|
@ -39,11 +39,11 @@
|
|
|
|
|
var message = $$("#messageInput").val().trim();
|
|
|
|
|
|
|
|
|
|
if (message) {
|
|
|
|
|
$$(".chat-content").append(`<div class="text-right mb-2"><span class="badge badge-primary">$${message}</span></div>`);
|
|
|
|
|
|
|
|
|
|
$$("#messageInput").val('');
|
|
|
|
|
$$("#hidep").append("{'role': 'user', 'content':'"+message+"'},")
|
|
|
|
|
allMessages=$$("#hidep").text()
|
|
|
|
|
|
|
|
|
|
$$(".chat-content").append(`<div class="text-right mb-2"><span class="badge badge-primary" ><p style="white-space: pre-wrap; width:220px; word-wrap: break-word; word-break:break-all;">$${message}<p></span></div>`);
|
|
|
|
|
$$("#sendButton").prop("disabled", true);
|
|
|
|
|
|
|
|
|
|
// Show loading spinner
|
|
|
|
@ -52,7 +52,7 @@
|
|
|
|
|
if(response) {
|
|
|
|
|
$$("#hidep").append("{'role': 'assistant', 'content':'"+response+"'},");
|
|
|
|
|
response=response.replace("\n","<br>")
|
|
|
|
|
$$(".chat-content").append(`<div class="text-left mb-2"><span class="badge badge-secondary">$${response}</span></div>`);
|
|
|
|
|
$$(".chat-content").append(`<div class="text-left mb-2"><span class="badge badge-secondary"><p style="white-space: pre-wrap; width:220px; word-wrap: break-word; word-break:break-all;">$${response}</p></span></div>`);
|
|
|
|
|
|
|
|
|
|
$$("#sendButton").prop("disabled", false);
|
|
|
|
|
$$('#loadingSpinner').remove();
|
|
|
|
|