From 21d3eafe6a0a1ff5d93723d55493281356d33c72 Mon Sep 17 00:00:00 2001 From: hecodex <13699448253@163.com> Date: Wed, 4 Jun 2025 21:41:41 +0800 Subject: [PATCH] add DashScopeProvider --- README.md | 2 ++ os_computer_use/config.py | 2 ++ os_computer_use/providers.py | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 7d95ae2..e197261 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ The providers are imported from [providers.py](/os_computer_use/providers.py) an - OS-Atlas (grounding) - ShowUI (grounding) - Moonshot +- DashScope - Mistral AI (Pixtral for vision, Mistral Large for actions) If you add a new model or provider, please [make a PR](../../pulls) to this repository with the updated providers.py! @@ -104,6 +105,7 @@ GEMINI_API_KEY=... OPENAI_API_KEY=... ANTHROPIC_API_KEY=... MOONSHOT_API_KEY=... +DASHSCOPE_API_KEY=... # Required: Provide your Hugging Face token to bypass Gradio rate limits. HF_TOKEN=... ``` diff --git a/os_computer_use/config.py b/os_computer_use/config.py index 1b3d04b..6f874be 100644 --- a/os_computer_use/config.py +++ b/os_computer_use/config.py @@ -11,6 +11,7 @@ # vision_model = providers.MoonshotProvider("moonshot-v1-vision") # vision_model = providers.MistralProvider("pixtral") #vision_model = providers.GroqProvider("llama-3.2") +# vision_model = providers.DashScopeProvider("qwen-vl-max") vision_model = providers.OpenRouterProvider("qwen-2.5-vl") # action_model = providers.FireworksProvider("llama-3.3") @@ -18,4 +19,5 @@ # action_model = providers.AnthropicProvider("claude-3.5-sonnet") # vision_model = providers.MoonshotProvider("moonshot-v1-vision") # action_model = providers.MistralProvider("mistral") +# action_model = providers.DashScopeProvider("qwen-max") action_model = providers.GroqProvider("llama-3.3") \ No newline at end of file diff --git a/os_computer_use/providers.py b/os_computer_use/providers.py index 9f25f48..28ec2b9 100644 --- a/os_computer_use/providers.py +++ b/os_computer_use/providers.py @@ -28,6 +28,14 @@ class OpenRouterProvider(OpenAIBaseProvider): "qwen-2.5-vl":"qwen/qwen2.5-vl-72b-instruct:free" } +class DashScopeProvider(OpenAIBaseProvider): + base_url = "https://dashscope.aliyuncs.com/compatible-mode/v1" + api_key = os.getenv("DASHSCOPE_API_KEY") + aliases = { + "qwen-max": "qwen-max", + "qwen-vl-max":"qwen-vl-max" + } + class FireworksProvider(OpenAIBaseProvider): base_url = "https://api.fireworks.ai/inference/v1"