Skip to content

Commit

Permalink
compatible to the steam response
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Nov 18, 2023
1 parent 62e2f9a commit 3779e0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions askchat/askchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

# print the response in a typewriter way
async def show_resp(chat):
async for resp in chat.async_stream_responses():
for char in resp.delta_content:
print(char, end='', flush=True)
await asyncio.sleep(0.015)
async for char in chat.async_stream_responses(textonly=True):
print(char, end='', flush=True)

def ask():
"""Interact with ChatGPT in terminal via chattool"""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

from setuptools import setup, find_packages

VERSION = '0.0.4'
VERSION = '0.0.5'

with open('README.md') as readme_file:
readme = readme_file.read()

requirements = ['chattool>=2.3.0']
requirements = ['chattool>=2.5.0']

test_requirements = ['pytest>=3']

Expand Down

0 comments on commit 3779e0e

Please sign in to comment.