From 884512721ebb34e416566c7da72516f3d8205288 Mon Sep 17 00:00:00 2001 From: rex <1073853456@qq.com> Date: Mon, 9 Oct 2023 10:45:40 +0800 Subject: [PATCH] fix bug of async & update debug_log --- chattool/__init__.py | 4 +++- chattool/asynctool.py | 2 +- setup.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/chattool/__init__.py b/chattool/__init__.py index e7502c5..6109a10 100644 --- a/chattool/__init__.py +++ b/chattool/__init__.py @@ -2,7 +2,7 @@ __author__ = """Rex Wang""" __email__ = '1073853456@qq.com' -__version__ = '2.3.0' +__version__ = '2.3.1' import os, sys, requests from .chattool import Chat, Resp @@ -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: diff --git a/chattool/asynctool.py b/chattool/asynctool.py index 624f266..1077cc1 100644 --- a/chattool/asynctool.py +++ b/chattool/asynctool.py @@ -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 ## saving files chatlog.append(resp.message) chat = Chat(chatlog) diff --git a/setup.py b/setup.py index d4236fe..5c06e38 100644 --- a/setup.py +++ b/setup.py @@ -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",