fix: 移除代理自动检测,改用直连模式

- 删除 base_client.py 中的 _detect_proxy/_get_proxy 代理检测逻辑
- 移除请求时动态注入 proxy 参数
- 设置 trust_env=False 避免读取系统/环境变量代理
- 新增 universal_llm 节点「令牌」输入,支持自定义 API Key

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
This commit is contained in:
o1key
2026-04-21 17:52:44 +08:00
co-authored by Claude Sonnet 4.5
parent 07f0c5ed5f
commit ba468f5ca0
3 changed files with 13 additions and 119 deletions
+10 -1
View File
@@ -80,6 +80,11 @@ class UniversalLLMChat:
"图片": ("IMAGE",),
"视频": ("VIDEO",),
"文件": ("FILE_LIST",),
"令牌": ("STRING", {
"default": "",
"multiline": False,
"placeholder": "留空则使用默认 API Key",
}),
},
"hidden": {
"node_id": "UNIQUE_ID",
@@ -370,6 +375,7 @@ class UniversalLLMChat:
图片: Optional[torch.Tensor] = None,
视频=None,
文件: Optional[FileList] = None,
令牌: str = "",
node_id: str = "",
) -> Tuple[str]:
start_time = time.time()
@@ -377,6 +383,9 @@ class UniversalLLMChat:
try:
self._ensure_config()
# 如果用户传入了自定义令牌,则覆盖默认 API Key
effective_api_key = 令牌.strip() if 令牌 and 令牌.strip() else self._api_key
# 构建 input
input_data = self._build_input(提示词, 图片, "", 文件, 视频)
@@ -416,7 +425,7 @@ class UniversalLLMChat:
async def _do_request():
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {self._api_key}",
"Authorization": f"Bearer {effective_api_key}",
}
url = f"{self._base_url}/v1/chat/completions"
timeout = aiohttp.ClientTimeout(total=120)