feat: model name log, args help hint and the proxy of key does not participate in the judgment.

This commit is contained in:
weiensong
2023-11-17 11:13:25 +08:00
parent aaacbf29ea
commit e247e7832d
7 changed files with 50 additions and 23 deletions

View File

@@ -6,7 +6,7 @@ from datetime import datetime
import openai
class ChatGPT():
class ChatGPT:
def __init__(self, key: str, api: str, proxy: str, prompt: str) -> None:
openai.api_key = key
@@ -17,6 +17,9 @@ class ChatGPT():
self.conversation_list = {}
self.system_content_msg = {"role": "system", "content": prompt}
def __repr__(self):
return 'ChatGPT'
def get_answer(self, question: str, wxid: str) -> str:
# wxid或者roomid,个人时为微信id群消息时为群id
self.updateMessage(wxid, question, "user")