mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-18 20:17:50 +00:00
started working on extensions
This commit is contained in:
parent
2a6ebab6df
commit
39470b1c32
2
app.py
2
app.py
@ -322,7 +322,7 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
app.config['executor'].submit(self.create_chatbot)
|
||||
|
||||
# Return a success response
|
||||
return json.dumps({"id": self.current_discussion.discussion_id, "time": timestamp, "welcome_message":self.personality["welcome_message"]})
|
||||
return json.dumps({"id": self.current_discussion.discussion_id, "time": timestamp, "welcome_message":self.personality["welcome_message"], "sender":self.personality["name"]})
|
||||
|
||||
def update_model_params(self):
|
||||
data = request.get_json()
|
||||
|
@ -6,5 +6,8 @@
|
||||
from config import load_config, save_config
|
||||
|
||||
class Extension():
|
||||
def __init__(self, metadata_file_path:str) -> None:
|
||||
self.config = load_config()
|
||||
def __init__(self, metadata_file_path:str, app) -> None:
|
||||
self.app = app
|
||||
self.metadata_file_path = metadata_file_path
|
||||
self.config = load_config(metadata_file_path)
|
||||
|
||||
|
@ -233,7 +233,7 @@ function populate_menu(){
|
||||
// Select the new discussion
|
||||
//selectDiscussion(discussionId);
|
||||
chatWindow.innerHTML=""
|
||||
addMessage("GPT4ALL", data.welcome_message,0);
|
||||
addMessage(data.sender, data.welcome_message,0);
|
||||
|
||||
populate_discussions_list()
|
||||
sendbtn.style.display="block";
|
||||
|
@ -26,9 +26,6 @@ function update_main(){
|
||||
waitAnimation.style.display="block";
|
||||
console.log("Sending message to bot")
|
||||
|
||||
let hiddenElement = undefined
|
||||
let messageTextElement = undefined
|
||||
|
||||
user_msg = addMessage('',message, 0, 0, can_edit=true);
|
||||
bot_msg = addMessage('', '', 0, 0, can_edit=true);
|
||||
|
||||
@ -81,8 +78,8 @@ function update_main(){
|
||||
bot_msg.setSender(infos.bot);
|
||||
bot_msg.setID(infos.response_id);
|
||||
|
||||
messageTextElement = bot_msg.messageTextElement;
|
||||
hiddenElement = bot_msg.hiddenElement;
|
||||
bot_msg.messageTextElement;
|
||||
bot_msg.hiddenElement;
|
||||
entry_counter ++;
|
||||
}
|
||||
else{
|
||||
@ -90,8 +87,8 @@ function update_main(){
|
||||
prefix = "FINAL:";
|
||||
if(text.startsWith(prefix)){
|
||||
text = text.substring(prefix.length);
|
||||
hiddenElement.innerHTML = text
|
||||
messageTextElement.innerHTML = text
|
||||
bot_msg.hiddenElement.innerHTML = text
|
||||
bot_msg.messageTextElement.innerHTML = text
|
||||
}
|
||||
else{
|
||||
// For the other enrtries, these are just the text of the chatbot
|
||||
@ -99,8 +96,8 @@ function update_main(){
|
||||
txt = hiddenElement.innerHTML;
|
||||
if (char != '\f') {
|
||||
txt += char
|
||||
hiddenElement.innerHTML = txt;
|
||||
messageTextElement.innerHTML = txt;
|
||||
bot_msg.hiddenElement.innerHTML = txt;
|
||||
bot_msg.messageTextElement.innerHTML = txt;
|
||||
}
|
||||
|
||||
// scroll to bottom of chat window
|
||||
|
Loading…
Reference in New Issue
Block a user