mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-02-20 17:22:47 +00:00
Merge pull request #159 from andzejsp/main
Added some todos in docs/dev/ and avatar placeholder
This commit is contained in:
commit
e2972250b3
@ -239,6 +239,124 @@ This Flask server provides various endpoints to manage and interact with the cha
|
||||
- "/settings": GET request endpoint to display the settings page.
|
||||
- "/help": GET request endpoint to display the help page.
|
||||
|
||||
## TODO Endpoints:
|
||||
|
||||
Here we list needed endpoints on th ebackend to make UI work as expected.
|
||||
|
||||
- "/get_all_personalities": GET request endpoint to get all personalities array
|
||||
|
||||
>This one should either return the names of installed personalieties or return same data what `"/get_current_personality"` returns.
|
||||
|
||||
|
||||
```
|
||||
[
|
||||
"personality": {
|
||||
"ai_message_prefix": "###gpt4all:\n",
|
||||
"anti_prompts": [
|
||||
"###user",
|
||||
"### user",
|
||||
"###gpt4all",
|
||||
"### gpt4all"
|
||||
],
|
||||
"assets_list": [
|
||||
"personalities\\english\\generic\\gpt4all\\assets\\logo.png"
|
||||
],
|
||||
"author": "ParisNeo",
|
||||
"category": "General",
|
||||
"dependencies": [],
|
||||
"disclaimer": "",
|
||||
"language": "en_XX",
|
||||
"link_text": "\n",
|
||||
"model_n_predicts": 1024,
|
||||
"model_repeat_last_n": 40,
|
||||
"model_repeat_penalty": 1.0,
|
||||
"model_temperature": 0.6,
|
||||
"model_top_k": 50,
|
||||
"model_top_p": 0.9,
|
||||
"name": "gpt4all",
|
||||
"personality_conditioning": "## Information:\nAssistant's name is gpt4all\nToday's date is {{date}}\n## Instructions:\nYour mission is to assist user to perform various tasks and answer his questions\n",
|
||||
"personality_description": "This personality is a helpful and Kind AI ready to help you solve your problems \n",
|
||||
"user_message_prefix": "###user:\n",
|
||||
"user_name": "user",
|
||||
"version": "1.0.0",
|
||||
"welcome_message": "Welcome! My name is gpt4all.\nHow can I help you today?\n"
|
||||
},
|
||||
"personality": {
|
||||
"ai_message_prefix": "###gpt4all:\n",
|
||||
"anti_prompts": [
|
||||
"###user",
|
||||
"### user",
|
||||
"###gpt4all",
|
||||
"### gpt4all"
|
||||
],
|
||||
"assets_list": [
|
||||
"personalities\\english\\generic\\gpt4all\\assets\\logo.png"
|
||||
],
|
||||
"author": "ParisNeo",
|
||||
"category": "General",
|
||||
"dependencies": [],
|
||||
"disclaimer": "",
|
||||
"language": "en_XX",
|
||||
"link_text": "\n",
|
||||
"model_n_predicts": 1024,
|
||||
"model_repeat_last_n": 40,
|
||||
"model_repeat_penalty": 1.0,
|
||||
"model_temperature": 0.6,
|
||||
"model_top_k": 50,
|
||||
"model_top_p": 0.9,
|
||||
"name": "gpt4all2",
|
||||
"personality_conditioning": "## Information:\nAssistant's name is gpt4all\nToday's date is {{date}}\n## Instructions:\nYour mission is to assist user to perform various tasks and answer his questions\n",
|
||||
"personality_description": "This personality is a helpful and Kind AI ready to help you solve your problems \n",
|
||||
"user_message_prefix": "###user:\n",
|
||||
"user_name": "user",
|
||||
"version": "1.0.0",
|
||||
"welcome_message": "Welcome! My name is gpt4all.\nHow can I help you today?\n"
|
||||
},
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
OR
|
||||
|
||||
```
|
||||
[
|
||||
"gpt4all",
|
||||
"gpt4all2",
|
||||
...
|
||||
]
|
||||
```
|
||||
|
||||
- "/get_personality": GET request endpoint to get speciffic data based on request
|
||||
|
||||
Idea here is to get requested data on demand.. sometimes you want to get only assets, and match them by name from message object in discussions.
|
||||
|
||||
> Request body:
|
||||
|
||||
```
|
||||
{
|
||||
"name",
|
||||
"assets_list",
|
||||
"author",
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
> Response:
|
||||
|
||||
[
|
||||
{
|
||||
"name":"gpt4all"
|
||||
"assets_list":['img1','sfx2']
|
||||
"author":"ParisNeo"
|
||||
},
|
||||
{
|
||||
"name":"gpt4all2"
|
||||
"assets_list":['sfx1']
|
||||
"author":"Lemon"
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
# Socketio endpoints
|
||||
These are the WebSocket server endpoints that are used to handle real-time communication between the client and server using the SocketIO library.
|
||||
|
||||
|
32
web/dist/assets/default_user-a2e0564e.svg
vendored
Normal file
32
web/dist/assets/default_user-a2e0564e.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.5 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>GPT4All - WEBUI</title>
|
||||
<script type="module" crossorigin src="/assets/index-caff7ea5.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-4db9d506.css">
|
||||
<script type="module" crossorigin src="/assets/index-200aefcd.js"></script>
|
||||
<link rel="stylesheet" href="/assets/index-02b31e38.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
32
web/src/assets/default_user.svg
Normal file
32
web/src/assets/default_user.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 7.5 KiB |
@ -3,8 +3,10 @@
|
||||
class="group rounded-lg m-2 shadow-lg hover:border-primary dark:hover:border-primary hover:border-solid hover:border-2 border-2 border-transparent even:bg-bg-light-discussion-odd dark:even:bg-bg-dark-discussion-odd flex-row p-4 pb-2">
|
||||
<div class="w-30 flex">
|
||||
<!-- SENDER -->
|
||||
<div class="w-10 h-10 rounded-lg object-fill drop-shadow-md group-even:bg-primary bg-secondary">
|
||||
<img v-if="senderImg" :src="senderImg" class="w-10 h-10 rounded-full object-fill ">
|
||||
<div class="w-10 h-10 rounded-lg object-fill drop-shadow-md">
|
||||
|
||||
<img :src="getImgUrl()" class="w-10 h-10 rounded-full object-fill text-red-700">
|
||||
|
||||
|
||||
</div>
|
||||
<p class="drop-shadow-sm py-0 px-2 text-lg text-opacity-95 font-bold ">{{ message.sender }}</p>
|
||||
@ -16,41 +18,38 @@
|
||||
</div>
|
||||
<div class="invisible group-hover:visible flex flex-row mt-3 -mb-2">
|
||||
<!-- MESSAGE CONTROLS -->
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2"
|
||||
title="Edit message">
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2" title="Edit message">
|
||||
<i data-feather="edit"></i>
|
||||
</div>
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2"
|
||||
title="Copy message to clipboard" @click.stop="copyContentToClipboard()">
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2" title="Copy message to clipboard"
|
||||
@click.stop="copyContentToClipboard()">
|
||||
<i data-feather="copy"></i>
|
||||
</div>
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2"
|
||||
title="Resend message">
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2" title="Resend message">
|
||||
<i data-feather="refresh-cw"></i>
|
||||
</div>
|
||||
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2"
|
||||
title="Remove message">
|
||||
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2" title="Remove message">
|
||||
<i data-feather="trash"></i>
|
||||
</div>
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2"
|
||||
title="Upvote">
|
||||
<div class="text-lg hover:text-secondary duration-75 active:scale-90 p-2" title="Upvote">
|
||||
<i data-feather="thumbs-up"></i>
|
||||
</div>
|
||||
<div class="flex flex-row items-center">
|
||||
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2"
|
||||
title="Downvote">
|
||||
<i data-feather="thumbs-down"></i>
|
||||
</div>
|
||||
<div class="text-lg hover:text-red-600 duration-75 active:scale-90 p-2" title="Downvote">
|
||||
<i data-feather="thumbs-down"></i>
|
||||
</div>
|
||||
<div v-if="message.rank != 0" class="rounded-full px-2 text-sm flex items-center justify-center font-bold"
|
||||
:class="message.rank > 0 ? 'bg-secondary' : 'bg-red-600'" title="Rank">{{ message.rank }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {nextTick} from 'vue'
|
||||
import botImgPlaceholder from "../assets/logo.svg"
|
||||
import userImgPlaceholder from "../assets/default_user.svg"
|
||||
import { nextTick } from 'vue'
|
||||
import feather from 'feather-icons'
|
||||
import MarkdownRenderer from './MarkdownRenderer.vue';
|
||||
export default {
|
||||
@ -64,19 +63,31 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
senderImg:''
|
||||
}
|
||||
},mounted(){
|
||||
nextTick(()=>{
|
||||
feather.replace()
|
||||
|
||||
})
|
||||
},methods:{
|
||||
copyContentToClipboard(){
|
||||
senderImg: ''
|
||||
}
|
||||
}, mounted() {
|
||||
this.senderImg = botImgPlaceholder
|
||||
nextTick(() => {
|
||||
feather.replace()
|
||||
|
||||
})
|
||||
}, methods: {
|
||||
copyContentToClipboard() {
|
||||
this.$emit('copy', this.message.content)
|
||||
navigator.clipboard.writeText(this.message.content);
|
||||
},
|
||||
getImgUrl() {
|
||||
|
||||
if (this.message.sender == "user") {
|
||||
return userImgPlaceholder;
|
||||
|
||||
}
|
||||
|
||||
return botImgPlaceholder;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user