Skip to content

Commit

Permalink
snap updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
nodeloc committed Jan 20, 2024
1 parent 140c3e2 commit 0d9d93f
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 3 deletions.
Binary file added COOKIES-NodeLoc
Binary file not shown.
Binary file added COOKIES-糊里糊涂
Binary file not shown.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ V2.0 增加了多用户的支持以及多ChatGPT key的轮询。
```
prompt请修改一下,以避免你和别人的答案类似,不同的prompt会产生截然不同的回答。

2024年1月20日 兼容了第三方ChatGPT接口


2024年1月17日 修复了不能T楼的小bug

Expand Down
3 changes: 3 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
{'username': 'username', 'password': '123456'},
# 添加更多的用户名和密码组合
]
chatgpt_api_url = 'https://api.openai.com'
chatgpt_model = 'gpt-3.5-turbo'
chatgpt_prompt = '你是一个常年混迹hostloc的人,帮助回答一些问题.'

chatgpt_keys = [
'chatgpt_key1',
Expand Down
6 changes: 3 additions & 3 deletions discuz.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def get_reply_tid(self):
sys.exit()

def chat_with_gpt(self, prompt):
url = "https://api.openai.com/v1/chat/completions"
url = config.chatgpt_api_url + "/v1/chat/completions"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer " + self.chatgpt_key,
}
data = {
"model": "gpt-3.5-turbo",
"model": config.chatgpt_model,
"messages": [
{"role": "system", "content": "你是一个常年混迹hostloc的人,帮助回答一些问题."},
{"role": "system", "content": config.chatgpt_prompt},
{"role": "user", "content": prompt}
],
"max_tokens": 500,
Expand Down
Loading

0 comments on commit 0d9d93f

Please sign in to comment.