Reformat codes
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from zhipuai import ZhipuAI
|
from zhipuai import ZhipuAI
|
||||||
|
|
||||||
|
|
||||||
class ZhiPu():
|
class ZhiPu():
|
||||||
def __init__(self, conf: dict) -> None:
|
def __init__(self, conf: dict) -> None:
|
||||||
self.api_key = conf.get("api_key")
|
self.api_key = conf.get("api_key")
|
||||||
@@ -9,7 +10,7 @@ class ZhiPu():
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def value_check(conf: dict) -> bool:
|
def value_check(conf: dict) -> bool:
|
||||||
if conf and conf.get("api_key") :
|
if conf and conf.get("api_key"):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ class ZhiPu():
|
|||||||
content = {"role": role, "content": str(msg)}
|
content = {"role": role, "content": str(msg)}
|
||||||
self.converstion_list[wxid].append(content)
|
self.converstion_list[wxid].append(content)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
from configuration import Config
|
from configuration import Config
|
||||||
config = Config().ZHIPU
|
config = Config().ZHIPU
|
||||||
|
|||||||
Reference in New Issue
Block a user