Update main.py

This commit is contained in:
Barbariskaa 2023-05-25 00:13:08 +03:00 committed by GitHub
parent 280fef4dd3
commit 58dc50ab8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -258,12 +258,14 @@ class SSEHandler(web.View):
else:
streaming_content_chunk = message['text'][wrote:]
streaming_content_chunk = streaming_content_chunk.replace('\\"', '\"')
response_text += streaming_content_chunk
if 'urls' in vars():
if urls:
streaming_content_chunk = link_placeholder_replacer.process(streaming_content_chunk, urls)
response_text += streaming_content_chunk
if stream:
await self.response.write(prepare_response(id, created, content=streaming_content_chunk))