@@ -1,19 +1,15 @@
|
|||||||
from pyexpat import model
|
|
||||||
from zhipuai import ZhipuAI
|
from zhipuai import ZhipuAI
|
||||||
|
|
||||||
class ZhiPu():
|
class ZhiPu():
|
||||||
def __init__(self, conf: dict) -> None:
|
def __init__(self, conf: dict) -> None:
|
||||||
api_key = conf.get("api_key")
|
self.api_key = conf.get("api_key")
|
||||||
model = conf.get("model", "glm-4") # 默认使用 glm-4 模型
|
self.model = conf.get("model", "glm-4") # 默认使用 glm-4 模型
|
||||||
self.api_key = api_key
|
self.client = ZhipuAI(api_key=self.api_key)
|
||||||
self.model = model
|
|
||||||
self.client = ZhipuAI(api_key=api_key)
|
|
||||||
self.converstion_list = {}
|
self.converstion_list = {}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def value_check(conf: dict) -> bool:
|
def value_check(conf: dict) -> bool:
|
||||||
if conf:
|
if conf and conf.get("api_key") :
|
||||||
if conf.get("api_key") :
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
@@ -81,4 +81,4 @@ bard: # -----bard配置这行不填-----
|
|||||||
|
|
||||||
zhipu: # -----zhipu配置这行不填-----
|
zhipu: # -----zhipu配置这行不填-----
|
||||||
api_key: #api key
|
api_key: #api key
|
||||||
model: glm-4 # 模型类型
|
model: # 模型类型
|
||||||
@@ -14,3 +14,4 @@ jupyter_client
|
|||||||
zhdate
|
zhdate
|
||||||
ipykernel
|
ipykernel
|
||||||
google-generativeai
|
google-generativeai
|
||||||
|
zhipuai
|
||||||
Reference in New Issue
Block a user