From ccdbe075746c39be6b6a93fa32abbdfd7a1fda7a Mon Sep 17 00:00:00 2001
From: Xinfan Chen <2024111082@stu.hit.edu.cn>
Date: Mon, 25 May 2026 17:12:52 +0800
Subject: [PATCH] update: dashscope api model name
---
video-claw/video-claw/backend/models/llm_dashscope.py | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/video-claw/video-claw/backend/models/llm_dashscope.py b/video-claw/video-claw/backend/models/llm_dashscope.py
index d776777..9f2f19a 100644
--- a/video-claw/video-claw/backend/models/llm_dashscope.py
+++ b/video-claw/video-claw/backend/models/llm_dashscope.py
@@ -45,13 +45,14 @@
if dashscope:
dashscope.api_key = self.api_key
- if self.base_url:
- dashscope.base_http_api_url = self.base_url
+ # Do not override base_url to avoid "url error" if config contains wrong path
+ # if self.base_url:
+ # dashscope.base_http_api_url = self.base_url
self.max_attempts = 3
self.max_tokens = 8000
- def query(self, prompt: str, image_urls: list = None, model: str = "qwen3.5-vl", web_search: bool = False):
+ def query(self, prompt: str, image_urls: list = None, model: str = "qwen-max", web_search: bool = False):
"""
Query Qwen model for text generation.
Note: This is for text-only LLM use. For image+text, use VLM client.
@@ -64,8 +65,15 @@
if dashscope is None:
raise RuntimeError("dashscope package not installed. Run: pip install dashscope")
- if not model:
- model = "qwen3.5-plus"
+ if not model or "qwen3.5" in model:
+ # 兼容处理遗留的 qwen3.5 传参,避免 url error
+ if "max" in model:
+ model = "qwen-max"
+ elif "turbo" in model:
+ model = "qwen-turbo"
+ else:
+ model = "qwen-plus"
+
messages = [{"role": "system", "content": "You are a helpful assistant."}]
messages.append({"role": "user", "content": prompt})
--
Gitblit v1.8.0