XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Fix load api_key

8f203941
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +2 -3
Modified g4f/tools/run_tools.py +2 -3
@@ -124,9 +124,9 @@ class AuthManager:
124 124 """Handles API key management"""
125 125
126 126 @staticmethod
127 def get_api_key_file(cls) -> Path:
127 def get_api_key_file(provider) -> Path:
128 128 """Get the path to the API key file for a provider"""
129 return Path(get_cookies_dir()) / f"auth_{cls.get_parent()}.json"
129 return Path(get_cookies_dir()) / f"auth_{provider if isinstance(provider, str) else provider.get_parent()}.json"
130 130
131 131 @staticmethod
132 132 def load_api_key(provider: Any) -> Optional[str]:
@@ -254,7 +254,6 @@ async def async_iter_run_tools(
254 254 if sources:
255 255 yield sources
256 256
257
258 257 def iter_run_tools(
259 258 iter_callback: Callable,
260 259 model: str,