-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
31 lines (26 loc) · 936 Bytes
/
Copy pathconfig.py
File metadata and controls
31 lines (26 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
import json
class XFYunConfig:
def __init__(self, app_id, api_key, api_secret):
self.app_id = app_id
self.api_key = api_key
self.api_secret = api_secret
class DeepSeekConfig:
def __init__(self, api_key, base_url, model):
self.api_key = api_key
self.base_url = base_url
self.model = model
class MiniMaxConfig:
def __init__(self, api_key):
self.api_key = api_key
class Config:
def __init__(self, path = "config.json"):
try:
with open(path, "r", encoding = "utf-8") as f:
config_dict = json.load(f)
except Exception as e:
print("读取失败:", e)
print("当前工作路径是:", os.getcwd())
print("目标文件路径是:", path)
self.xfyun = XFYunConfig(**config_dict.get("xfyun", {}))
self.minimax = MiniMaxConfig(**config_dict.get('minimax', {}))