Update main.py
This commit is contained in:
parent
280fef4dd3
commit
58dc50ab8f
6
main.py
6
main.py
|
@ -258,12 +258,14 @@ class SSEHandler(web.View):
|
||||||
else:
|
else:
|
||||||
streaming_content_chunk = message['text'][wrote:]
|
streaming_content_chunk = message['text'][wrote:]
|
||||||
streaming_content_chunk = streaming_content_chunk.replace('\\"', '\"')
|
streaming_content_chunk = streaming_content_chunk.replace('\\"', '\"')
|
||||||
response_text += streaming_content_chunk
|
|
||||||
|
|
||||||
if 'urls' in vars():
|
if 'urls' in vars():
|
||||||
if urls:
|
if urls:
|
||||||
streaming_content_chunk = link_placeholder_replacer.process(streaming_content_chunk, urls)
|
streaming_content_chunk = link_placeholder_replacer.process(streaming_content_chunk, urls)
|
||||||
|
|
||||||
|
response_text += streaming_content_chunk
|
||||||
|
|
||||||
if stream:
|
if stream:
|
||||||
await self.response.write(prepare_response(id, created, content=streaming_content_chunk))
|
await self.response.write(prepare_response(id, created, content=streaming_content_chunk))
|
||||||
|
|
||||||
|
@ -342,4 +344,4 @@ if __name__ == '__main__':
|
||||||
f"Режим precise: http://{HOST}:{PORT}/precise\n"
|
f"Режим precise: http://{HOST}:{PORT}/precise\n"
|
||||||
f"Режим balanced: http://{HOST}:{PORT}/balanced\n"
|
f"Режим balanced: http://{HOST}:{PORT}/balanced\n"
|
||||||
f"Также есть режим подсказок от Бинга. Чтобы его включить, нужно добавить /suggestion к концу URL, после режима.")
|
f"Также есть режим подсказок от Бинга. Чтобы его включить, нужно добавить /suggestion к концу URL, после режима.")
|
||||||
web.run_app(app, host=HOST, port=PORT, print=None)
|
web.run_app(app, host=HOST, port=PORT, print=None)
|
||||||
|
|
Loading…
Reference in New Issue