diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index db11fec..f1276fc 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.145 +version = 0.1.147 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index 3cdd12b..996c6c6 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.2 Name: guan -Version: 0.1.145 +Version: 0.1.147 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index a60c6e8..931cf1a 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -1,7 +1,7 @@ # Module: data_processing # AI 对话 -def chat(prompt='你好', model=1, stream=1): +def chat(prompt='你好', model=1, stream=1, stream_label=0): import requests url = "http://api.guanjihuan.com/chat" data = { @@ -9,7 +9,8 @@ def chat(prompt='你好', model=1, stream=1): "model": model, } if stream == 1: - print('\n--- Start Chat Stream Message ---\n') + if stream_label == 1: + print('\n--- Start Chat Stream Message ---\n') requests_response = requests.post(url, json=data, stream=True) response = '' if requests_response.status_code == 200: @@ -18,10 +19,12 @@ def chat(prompt='你好', model=1, stream=1): if stream == 1: print(line.decode('utf-8'), end='', flush=True) response += line.decode('utf-8') + print() else: pass if stream == 1: - print('\n\n--- End Chat Stream Message ---\n') + if stream_label == 1: + print('\n\n--- End Chat Stream Message ---\n') return response # 加上函数代码的 AI 对话