|
|
|
@ -3,12 +3,12 @@
|
|
|
|
|
<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>
|
|
|
|
|
<body>
|
|
|
|
|
<textarea id="hidep" style="display: none;"></textarea>
|
|
|
|
|
<textarea id="hidep" style="display: none; "></textarea>
|
|
|
|
|
<div class="container mt-5">
|
|
|
|
|
<div class="chat-box border rounded">
|
|
|
|
|
<div class="d-flex justify-content-between align-items-center p-3 bg-light">
|
|
|
|
@ -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();
|
|
|
|
|