Skip to content

Commit

Permalink
fix bug of async & update debug_log
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Oct 9, 2023
1 parent 17a7d22 commit 8845127
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion chattool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Rex Wang"""
__email__ = '[email protected]'
__version__ = '2.3.0'
__version__ = '2.3.1'

import os, sys, requests
from .chattool import Chat, Resp
Expand Down Expand Up @@ -89,6 +89,8 @@ def debug_log( net_url:str="https://www.baidu.com"
## Base url
print("\nCheck your base url:")
show_base_url()
print("\nCheck the OpenAI Base url:")
print(os.environ.get("OPENAI_BASE_URL"))

## Please check your API key
if test_apikey:
Expand Down
2 changes: 1 addition & 1 deletion chattool/asynctool.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async def chat_complete(ind, locker, chatlog, chkpoint, **options):
resp = Resp(json.loads(response))
if not resp.is_valid():
warnings.warn(f"Invalid response: {resp.error_message}")
return False
return 0, 0

Check warning on line 101 in chattool/asynctool.py

View check run for this annotation

Codecov / codecov/patch

chattool/asynctool.py#L101

Added line #L101 was not covered by tests
## saving files
chatlog.append(resp.message)
chat = Chat(chatlog)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with open('README.md') as readme_file:
readme = readme_file.read()

VERSION = '2.3.0'
VERSION = '2.3.1'

requirements = [
'Click>=7.0', 'requests>=2.20', "responses>=0.23",
Expand Down

0 comments on commit 8845127

Please sign in to comment.