mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
refactor(proxy): 端点检查统一使用 proxy_config 替代 proxy_param
将 endpoint_checker、handler_adapter_base、gemini adapter 及 provider_query 中的 proxy_param 参数替换为 proxy_config, 通过 build_proxy_client_kwargs 统一构建代理客户端参数, 以支持 tunnel 模式代理。同时清理未使用的 import。
This commit is contained in:
@@ -9,7 +9,6 @@ import asyncio
|
||||
import json
|
||||
from typing import Any
|
||||
|
||||
import httpx
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from sqlalchemy.orm import Session, joinedload
|
||||
@@ -36,7 +35,7 @@ from src.services.model.upstream_fetcher import (
|
||||
get_adapter_for_format,
|
||||
)
|
||||
from src.services.provider.oauth_token import resolve_oauth_access_token
|
||||
from src.services.proxy_node.resolver import resolve_effective_proxy, resolve_proxy_param
|
||||
from src.services.proxy_node.resolver import resolve_effective_proxy
|
||||
from src.utils.auth_utils import get_current_user
|
||||
|
||||
router = APIRouter(prefix="/api/admin/provider-query", tags=["Provider Query"])
|
||||
@@ -807,7 +806,6 @@ async def test_model(
|
||||
test_proxy = resolve_effective_proxy(
|
||||
getattr(provider, "proxy", None), getattr(api_key, "proxy", None)
|
||||
)
|
||||
test_proxy_param = resolve_proxy_param(test_proxy)
|
||||
|
||||
logger.debug("[test-model] 开始端点测试...")
|
||||
|
||||
@@ -832,7 +830,7 @@ async def test_model(
|
||||
auth_type=auth_type,
|
||||
provider_type=p_type if p_type else None,
|
||||
decrypted_auth_config=oauth_meta if oauth_meta else None,
|
||||
proxy_param=test_proxy_param,
|
||||
proxy_config=test_proxy,
|
||||
)
|
||||
|
||||
def _response_has_error(resp: dict) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user