Update src/ZhipuClient.py
Browse files- src/ZhipuClient.py +11 -11
src/ZhipuClient.py
CHANGED
@@ -3,18 +3,18 @@ import os
|
|
3 |
|
4 |
class ZhipuClient:
|
5 |
def __init__(self, api_key_file_path = None):
|
6 |
-
if api_key_file_path is None:
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
|
17 |
-
self.api_key =
|
18 |
self.client = ZhipuAI(api_key=self.api_key)
|
19 |
|
20 |
def _load_access_token(self, file_path):
|
|
|
3 |
|
4 |
class ZhipuClient:
|
5 |
def __init__(self, api_key_file_path = None):
|
6 |
+
# if api_key_file_path is None:
|
7 |
+
# cands = ['./datas/zhipu_key.txt', '../datas/zhipu_key.txt']
|
8 |
+
# flag = False
|
9 |
+
# for cand in cands:
|
10 |
+
# if os.path.exists(cand):
|
11 |
+
# api_key_file_path = cand
|
12 |
+
# flag = True
|
13 |
+
# break
|
14 |
+
# if not flag:
|
15 |
+
# raise ValueError("No valid api key file found.")
|
16 |
|
17 |
+
self.api_key = os.getenv("ZHIPU_4_API")
|
18 |
self.client = ZhipuAI(api_key=self.api_key)
|
19 |
|
20 |
def _load_access_token(self, file_path):
|