From bd2b81d8f9ec4e9363102f5b7dbd6bfaa8bc65f9 Mon Sep 17 00:00:00 2001 From: msl <1064268333@qq.com> Date: Fri, 20 Oct 2023 21:21:28 +0800 Subject: [PATCH] up --- .../__pycache__/chatweb.cpython-311.pyc | Bin 3035 -> 3096 bytes src/chatweb/chat.html | 9 ++++----- src/chatweb/chatweb.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/chatweb/__pycache__/chatweb.cpython-311.pyc b/src/chatweb/__pycache__/chatweb.cpython-311.pyc index 6b06d3c1a48795664a2312524232ed7277b9fbb9..1fc642ef66dd790ad35865eea9c69ad1b538a3b5 100644 GIT binary patch delta 190 zcmcaDK0|_cIWI340}#a57^NQC$Sc9b#+qJGqH8kQnCUsA=w@l=OjgEElUq4fvZOFB zV4s}GDl*xMQ(&?Vrz!`NUlmhzttQ9hP$1_PTUvfmZeq#gDo#Vju*qvUt$1&6@%QU= z=}ai>)bG)s{Djk6l$}-Z0|PoS*@df%(RT8AuH70Oj6iuz;v-1x3qnF@@+NLg0F>)9 AXaE2J delta 158 zcmbOsaa){sIWI340}#A@Y?!)!Bd-J#A8&d=iLSApscuPWQBwY7ZKmgpvYUmOGg%o= zOs?fvIXQq+nT63$lYMeEr|RStoQ90^ktDTDw3 diff --git a/src/chatweb/chat.html b/src/chatweb/chat.html index 1509c2a..b80b036 100644 --- a/src/chatweb/chat.html +++ b/src/chatweb/chat.html @@ -41,18 +41,17 @@ if (message) { $$("#messageInput").val(''); - $$("#hidep").append("{'role': 'user', 'content':'"+message+"'},") + $$("#hidep").append("{'role': 'user', 'content':'''"+message+"'''},") allMessages=$$("#hidep").text() - $$(".chat-content").append(`

$${message}

`); + $$(".chat-content").append(`

$${message}

`); $$("#sendButton").prop("disabled", true); // Show loading spinner $$(".chat-content").append('
Loading...
'); $$.post("/chat", { messages: allMessages }, function(response){ if(response) { - $$("#hidep").append("{'role': 'assistant', 'content':'"+response+"'},"); - response=response.replace("\n","
") - $$(".chat-content").append(`

$${response}

`); + $$("#hidep").append("{'role': 'assistant', 'content':'''"+response+"'''},"); + $$(".chat-content").append(`

$${response}

`); $$("#sendButton").prop("disabled", false); $$('#loadingSpinner').remove(); diff --git a/src/chatweb/chatweb.py b/src/chatweb/chatweb.py index cfb63fb..2d75be3 100644 --- a/src/chatweb/chatweb.py +++ b/src/chatweb/chatweb.py @@ -39,7 +39,7 @@ class chat: def POST(self): i=web.input().messages i=list(eval(i)) - print(i) + x=chatgpt(i) print(x) return x