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

@@ -16,7 +16,7 @@ from chatglm.tool_registry import dispatch_tool, extract_code, get_tools
functions = get_tools()
class ChatGLM():
class ChatGLM:
def __init__(self, config={}, wcf: Optional[Wcf] = None, max_retry=5) -> None:
openai.api_key = config.get('key', 'XXX')
@@ -35,6 +35,9 @@ class ChatGLM():
"tool": [{"role": "system", "content": "Answer the following questions as best as you can. You have access to the following tools:"}],
"code": [{"role": "system", "content": "你是一位智能AI助手你叫ChatGLM你连接着一台电脑但请注意不能联网。在使用Python解决任务时你可以运行代码并得到结果如果运行结果有错误你需要尽可能对代码进行改进。你可以处理用户上传到电脑上的文件文件默认存储路径是{}".format(self.filePath)}]}
def __repr__(self):
return 'ChatGLM'
def get_answer(self, question: str, wxid: str) -> str:
# wxid或者roomid,个人时为微信id群消息时为群id
if '#帮助' == question: