diff --git a/.gitignore b/.gitignore index d1e9e47..b241a18 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea sparkdesk_web/log dist -build \ No newline at end of file +build +history \ No newline at end of file diff --git a/README.md b/README.md index 2e4dfac..9063ef7 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ > 如果该项目对你有帮助,不要忘记给我点个 star 哦! ## 使用方法 ```shell -pip install sparkdesk-api==1.2.0 +pip install sparkdesk-api==1.3.0 ``` 或者 ```shell -pip install sparkdesk-api==1.2.0 -i https://pypi.org/simple +pip install sparkdesk-api==1.3.0 -i https://pypi.org/simple ``` ### 1. Web模式 diff --git a/setup.py b/setup.py index 9f1fc0f..3fa76e6 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="sparkdesk-api", - version="1.2.0", + version="1.3.0", author="HildaM", author_email="Hilda_quan@163.com", description="sparkdesk-api 讯飞星火大模型api", diff --git a/sparkdesk_web/core.py b/sparkdesk_web/core.py index 512687e..a4d8541 100644 --- a/sparkdesk_web/core.py +++ b/sparkdesk_web/core.py @@ -134,11 +134,11 @@ def __streaming_output(self, question): print("\n") return response_text, True - def chat_stream(self, history: bool = False, history_path: str = './data/'): + def chat_stream(self, history: bool = False, history_path: str = './history/'): history_file_path = '' if history: FileUtils.check_dir_path(history_path) - history_file_path = os.path.join(history_path, f'history_{str(datetime.now())}.json') + history_file_path = os.path.join(history_path, f'history_{str(datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))}.json') try: self.__create_chat(NEW_CHAT) print("Enter exit or stop to end the conversation.\n") diff --git a/sparkdesk_web_cli.py b/sparkdesk_web_cli.py index 06736ca..2a43bef 100644 --- a/sparkdesk_web_cli.py +++ b/sparkdesk_web_cli.py @@ -27,5 +27,7 @@ # continue chat chat = sparkWeb.create_continuous_chat() - print(chat.chat("请介绍一下西安")) + # while True: + # print(chat.chat(input("Ask: "))) + print(chat.chat("肇庆是一个什么样的城市")) print(chat.chat("刚才你说的是哪个城市?")) \ No newline at end of file