Skip to content

Commit

Permalink
修复缺陷
Browse files Browse the repository at this point in the history
  • Loading branch information
HildaM committed Oct 8, 2023
1 parent 09bd909 commit f7d8f4b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea
sparkdesk_web/log
dist
build
build
history
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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模式
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="sparkdesk-api",
version="1.2.0",
version="1.3.0",
author="HildaM",
author_email="[email protected]",
description="sparkdesk-api 讯飞星火大模型api",
Expand Down
4 changes: 2 additions & 2 deletions sparkdesk_web/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 3 additions & 1 deletion sparkdesk_web_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("刚才你说的是哪个城市?"))

0 comments on commit f7d8f4b

Please sign in to comment.