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

XFEstudio/gpt4free

fix: ensure api_key validation checks for string type in is_provider_api_key function

9b608fcc
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +1 -1
Modified g4f/tools/run_tools.py +1 -1
@@ -42,7 +42,7 @@ TOOL_NAMES = {
42 42 }
43 43
44 44 def is_provider_api_key(api_key: str) -> bool:
45 return api_key and not api_key.startswith("g4f_") and not api_key.startswith("gfs_")
45 return isinstance(api_key, str) and api_key and not api_key.startswith("g4f_") and not api_key.startswith("gfs_")
46 46
47 47
48 48 class ToolHandler: