Commit 8bc16667 authored by tongzifang's avatar tongzifang

fix: update default model names to match CU Cloud AI gateway

The gateway returns HTTP 404 because qwen3.5-plus and qwen3-coder-plus
are not valid model IDs. Updated defaults to Qwen3.5-397B-A17B and
Qwen3-235B-A22B which are available on the CU Cloud gateway.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 7fe66aa1
...@@ -6,8 +6,8 @@ import os ...@@ -6,8 +6,8 @@ import os
# ─── 配置(全部从环境变量读取) ────────────────────────────── # ─── 配置(全部从环境变量读取) ──────────────────────────────
API_URL = os.environ.get("AI_REVIEW_API_URL", "https://coding.dashscope.aliyuncs.com/v1/chat/completions") API_URL = os.environ.get("AI_REVIEW_API_URL", "https://coding.dashscope.aliyuncs.com/v1/chat/completions")
API_KEY = os.environ.get("AI_REVIEW_API_KEY", "") API_KEY = os.environ.get("AI_REVIEW_API_KEY", "")
MODEL = os.environ.get("AI_REVIEW_MODEL", "qwen3.5-plus") MODEL = os.environ.get("AI_REVIEW_MODEL", "Qwen3.5-397B-A17B")
TRIAGE_MODEL = os.environ.get("AI_REVIEW_TRIAGE_MODEL", "qwen3-coder-plus") TRIAGE_MODEL = os.environ.get("AI_REVIEW_TRIAGE_MODEL", "Qwen3-235B-A22B")
FEISHU_WEBHOOK = os.environ.get("FEISHU_WEBHOOK_URL", "") FEISHU_WEBHOOK = os.environ.get("FEISHU_WEBHOOK_URL", "")
MAX_DIFF_LINES = int(os.environ.get("AI_REVIEW_MAX_DIFF_LINES", "2000")) MAX_DIFF_LINES = int(os.environ.get("AI_REVIEW_MAX_DIFF_LINES", "2000"))
......
...@@ -139,8 +139,12 @@ def call_llm(system_msg, user_msg, max_tokens=4096, timeout=300, model=None, ena ...@@ -139,8 +139,12 @@ def call_llm(system_msg, user_msg, max_tokens=4096, timeout=300, model=None, ena
"max_tokens": max_tokens "max_tokens": max_tokens
} }
if enable_thinking: if enable_thinking:
# 兼容联通云 AI 网关(OpenAI 兼容协议)
# 部分网关通过 temperature=1 + 去掉 system 来触发 thinking
# 也尝试发送通用 thinking 参数,网关会忽略不支持的字段
payload["enable_thinking"] = True payload["enable_thinking"] = True
payload["thinking_budget"] = 8192 payload["thinking_budget"] = 8192
payload["temperature"] = 1 # thinking 模型通常要求 temperature=1
headers = { headers = {
"Content-Type": "application/json", "Content-Type": "application/json",
"Authorization": f"Bearer {API_KEY}" "Authorization": f"Bearer {API_KEY}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment