|
7 | 7 |
|
8 | 8 |
|
9 | 9 | class HuaweiCloudMaasLargeLanguageModel(OAICompatLargeLanguageModel): |
10 | | - _BASE_URL_V1 = "https://api.modelarts-maas.com/v1" |
11 | 10 | _BASE_URL_V2 = "https://api.modelarts-maas.com/v2" |
12 | 11 | _THINKING_PATH_XDS = "thinking.type.enabled" |
13 | 12 | _THINKING_PATH_VLLM = "chat_template_kwargs.enable_thinking.true" |
14 | 13 |
|
15 | | - endpoint_mapping = { |
16 | | - "deepseek-v3.2": _BASE_URL_V2, |
17 | | - "deepseek-v3.2-exp": _BASE_URL_V2, |
18 | | - "deepseek-v3.1-terminus": _BASE_URL_V2, |
19 | | - "DeepSeek-V3": _BASE_URL_V2, |
20 | | - "deepseek-r1-250528": _BASE_URL_V2, |
21 | | - "DeepSeek-R1": _BASE_URL_V2, |
22 | | - "Kimi-K2": _BASE_URL_V2, |
23 | | - "longcat-flash-chat": _BASE_URL_V2, |
24 | | - "glm-5": _BASE_URL_V2, |
25 | | - "glm-5.1": _BASE_URL_V2, |
26 | | - "kimi-k2.6": _BASE_URL_V2, |
27 | | - "deepseek-v4-flash": _BASE_URL_V2, |
28 | | - "qwen3-235b-a22b": _BASE_URL_V2, |
29 | | - "qwen3-30b-a3b": _BASE_URL_V2, |
30 | | - "qwen3-32b": _BASE_URL_V2, |
31 | | - "qwen3-coder-480b-a35b-instruct": _BASE_URL_V2, |
32 | | - "qwen2.5-vl-72b": _BASE_URL_V2, |
33 | | - } |
34 | | - |
35 | 14 | thinking_mapping = { |
36 | 15 | "deepseek-v3.2": _THINKING_PATH_XDS, |
37 | 16 | "deepseek-v3.2-exp": _THINKING_PATH_XDS, |
38 | 17 | "deepseek-v3.1-terminus": _THINKING_PATH_XDS, |
39 | 18 | "qwen3-235b-a22b": _THINKING_PATH_VLLM, |
40 | 19 | "qwen3-32b": _THINKING_PATH_VLLM, |
41 | 20 | "qwen3-30b-a3b": _THINKING_PATH_VLLM, |
42 | | - "glm-5": _THINKING_PATH_VLLM, |
43 | | - "glm-5.1": _THINKING_PATH_VLLM, |
| 21 | + "glm-5": _THINKING_PATH_XDS, |
| 22 | + "glm-5.1": _THINKING_PATH_XDS, |
| 23 | + "glm-5.2": _THINKING_PATH_XDS, |
44 | 24 | "kimi-k2.6": _THINKING_PATH_XDS, |
45 | 25 | "deepseek-v4-flash": _THINKING_PATH_XDS, |
| 26 | + "deepseek-v4-pro": _THINKING_PATH_XDS, |
| 27 | + "openpangu-2.0-flash": _THINKING_PATH_XDS, |
46 | 28 | } |
47 | 29 |
|
48 | 30 | def _invoke( |
@@ -82,10 +64,7 @@ def validate_credentials(self, model: str, credentials: dict) -> None: |
82 | 64 |
|
83 | 65 | def _add_custom_parameters(self, model: str, credentials: dict) -> None: |
84 | 66 | credentials["mode"] = "chat" |
85 | | - endpoint_url = HuaweiCloudMaasLargeLanguageModel.endpoint_mapping.get( |
86 | | - model, HuaweiCloudMaasLargeLanguageModel._BASE_URL_V1 |
87 | | - ) |
88 | | - credentials["endpoint_url"] = str(credentials.get("endpoint_url", endpoint_url)) |
| 67 | + credentials["endpoint_url"] = str(credentials.get("endpoint_url", self._BASE_URL_V2)) |
89 | 68 |
|
90 | 69 | def _add_function_call(self, model: str, credentials: dict) -> None: |
91 | 70 | model_schema = self.get_model_schema(model, credentials) |
|
0 commit comments