Update main.py

This commit is contained in:
Barbariskaa 2023-06-03 01:06:48 +03:00 committed by GitHub
parent 6cf4ebb25a
commit b02fde3fcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -398,10 +398,7 @@ class SSEHandler(web.View):
url = f"{REDIRECT_PROXY}v1/chat/completions"
else:
url = f"{REDIRECT_PROXY}/v1/chat/completions"
print(url)
# Use await to wait for the response
async with session.post(url, headers=headers, json=body) as response:
# Use async for to iterate over the response chunks
async for chunk in response.content.iter_chunked(1024):
await self.response.write(chunk)
else:
@ -485,4 +482,4 @@ if __name__ == '__main__':
f"Режим balanced: http://{HOST}:{PORT}/balanced\n"
f"Есть режим подсказок от Бинга. Чтобы его включить, нужно добавить /suggestion после выбранного режима.\n"
f"И еще есть режим переброса, нужный для того чтобы победить шиканье креативной Сидни. Включается добавлением /redirect после режима.")
web.run_app(app, host=HOST, port=PORT, print=None)
web.run_app(app, host=HOST, port=PORT, print=None)