diff --git a/claude_bridge_glm.py b/claude_bridge_glm.py index 7ed72a2..ef0deed 100644 --- a/claude_bridge_glm.py +++ b/claude_bridge_glm.py @@ -15,8 +15,8 @@ import httpx SMETA_DIR = Path(os.environ.get("SMETA_PROJECT_DIR", os.path.expanduser("~/smeta-railway"))) ZAI_API_KEY = os.environ.get("ZAI_API_KEY", "") -ZAI_BASE_URL = os.environ.get("ZAI_BASE_URL", "https://open.bigmodel.cn/api/paas/v4") -ZAI_MODEL = os.environ.get("ZAI_MODEL", "glm-4-plus") +ZAI_BASE_URL = os.environ.get("ZAI_BASE_URL", "https://open.bigmodel.cn/api/coding/paas/v4") +ZAI_MODEL = os.environ.get("ZAI_MODEL", "glm-5") DATA_DIR = Path(os.environ.get("DATA_DIR", "./smeta-web-data")) # Session tracking: (username, tab_id) -> conversation history @@ -156,8 +156,9 @@ async def stream_claude( # Stream from GLM API full_response = "" + proxy = os.environ.get("HTTPS_PROXY") or os.environ.get("HTTP_PROXY") try: - async with httpx.AsyncClient(timeout=60) as client: + async with httpx.AsyncClient(timeout=60, proxy=proxy) as client: resp = await client.post( f"{ZAI_BASE_URL}/chat/completions", headers={"Authorization": f"Bearer {ZAI_API_KEY}"},