Xinfan Chen
2026-05-25 ccdbe075746c39be6b6a93fa32abbdfd7a1fda7a
update: dashscope api model name
2 files modified
22 ■■■■■ changed files
video-claw/video-claw/backend/models/llm_client.py 4 ●●●●● patch | view | raw | blame | history
video-claw/video-claw/backend/models/llm_dashscope.py 18 ●●●●● patch | view | raw | blame | history
video-claw/video-claw/backend/models/llm_client.py
@@ -88,10 +88,10 @@
                proxy=Config.provider_proxy("openai"),
            )
            result = client.query(prompt, image_urls=image_urls, model=model, web_search=web_search)
        elif "kimi" in model_lower or "qwen3.6-plus" in model_lower or "qwen3.6-flash" in model_lower:
        elif "kimi" in model_lower or "qwen3.6-plus" in model_lower or "qwen3.6-flash" in model_lower or "vl" in model_lower:
            # DashScope VLM models (using MultiModalConversation API)
            dashscope_vl_client = QwenVLClient(api_key=self.dashscope_api_key)
            result = dashscope_vl_client.chat(text=prompt, images=[], model=model, stream=False)
            result = dashscope_vl_client.chat(text=prompt, images=image_urls, model=model, stream=False)
        elif "deepseek-v3.2" in model_lower:
            # DeepSeek v3.2 (通过 DashScope Generation API)
            client = QwenLLM(api_key=self.dashscope_api_key)
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})