SimpleChat: Diff user/assistant msgs, Make input wider
Also show a default message to user Also add some metas
This commit is contained in:
parent
7d772f6b9a
commit
9942851273
2 changed files with 20 additions and 2 deletions
|
@ -1,10 +1,25 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Simple LlamaCPP Chat</title>
|
||||
<meta name="message" content="Save Nature Save Earth" />
|
||||
<meta name="description" content="Simple chat / test LLM web service endpoints /completions and /chat/completions" />
|
||||
<meta name="author" content="by Humans for All" />
|
||||
<script src="simplechat.js"></script>
|
||||
<style>
|
||||
.role-user {
|
||||
background-color: lightgray;
|
||||
}
|
||||
#user {
|
||||
width: 90vh;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="chat"></div>
|
||||
<p> SimpleChat </p>
|
||||
<hr>
|
||||
<div id="chat">
|
||||
<p> Enter your text to the ai assistant below</p>
|
||||
</div>
|
||||
<hr>
|
||||
<input type="text" id="user"/>
|
||||
<button id="submit">submit</button>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// @ts-check
|
||||
// A simple completions and chat/completions test related web front end logic
|
||||
// by Humans for All
|
||||
|
||||
class Roles {
|
||||
static System = "system";
|
||||
|
@ -39,6 +41,7 @@ class SimpleChat {
|
|||
}
|
||||
for(const x of this.xchat) {
|
||||
let entry = document.createElement("p");
|
||||
entry.className = `role-${x.role}`;
|
||||
entry.innerText = `${x.role}: ${x.content}`;
|
||||
div.appendChild(entry);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue