++
This commit is contained in:
+10
-7
@@ -2,12 +2,8 @@
|
||||
import json
|
||||
import httpx
|
||||
|
||||
with open('config.json', 'r') as f:
|
||||
config = json.load(f)
|
||||
siliconflow = config['siliconflow']
|
||||
token = siliconflow['api_keys']
|
||||
headers = {"Authorization": f"Bearer sk-pvdiisdowmuwkrpnxsrlhxaovicqibmlljwrwwvbbdjaitdl"}
|
||||
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
|
||||
def get_user_info():
|
||||
# 获取用户信息
|
||||
@@ -30,8 +26,15 @@ def get_models_info():
|
||||
|
||||
data = response.json()['data']
|
||||
|
||||
model_list = []
|
||||
|
||||
for d in data:
|
||||
print(d)
|
||||
if d.get('object') and d.get('object') == 'model':
|
||||
model_name = d.get('id')
|
||||
# print(model_name)
|
||||
model_list.append(model_name)
|
||||
|
||||
print(model_list)
|
||||
|
||||
# get_models_info()
|
||||
# get_user_info()
|
||||
get_user_info()
|
||||
|
||||
Reference in New Issue
Block a user