Update webapp.py

This commit is contained in:
Joseph Cheung 2023-02-21 21:56:32 +08:00
parent 49d3ec1b86
commit 3aef4963a3

View file

@ -799,8 +799,7 @@ def search():
"stream": True "stream": True
} }
gpt = json.dumps({'data':gpt_data, 'url_pair':url_pair}) gpt = json.dumps({'data':gpt_data, 'url_pair':url_pair})
gpt = '<div id="chat"></div>' + gpt gpt = '<div id="chat"></div>' + r'''<div id="chat_continue" style="display:none">
gpt = gpt + r'''<div id="chat_continue" style="display:none">
<hr> <hr>
<textarea id="chat_input" style="margin: auto;display: block;background: rgb(209 219 250 / 30%);outline: 0px;color: var(--color-search-font);font-size: 1.2rem;border-radius: 3px;border: none;height: 3em;resize: vertical;width: 75%;"></textarea> <textarea id="chat_input" style="margin: auto;display: block;background: rgb(209 219 250 / 30%);outline: 0px;color: var(--color-search-font);font-size: 1.2rem;border-radius: 3px;border: none;height: 3em;resize: vertical;width: 75%;"></textarea>
<button id="chat_send" style=" <button id="chat_send" style="
@ -837,8 +836,7 @@ def search():
background: rgba(211, 173, 209, 0.4); background: rgba(211, 173, 209, 0.4);
} }
</style> </style>
''' ''' + '<div id="prompt" style="display:none">' + gpt + '</div>'
gpt = gpt + '<div id="prompt" style="display:none">' + '</div>'
# gpt_response = requests.post(gpt_url, headers=gpt_headers, data=json.dumps(gpt_data)) # gpt_response = requests.post(gpt_url, headers=gpt_headers, data=json.dumps(gpt_data))
# gpt_json = gpt_response.json() # gpt_json = gpt_response.json()
# if 'choices' in gpt_json: # if 'choices' in gpt_json: