Selaa lähdekoodia

add Spark Max-32K (#8676)

AAEE86 7 kuukautta sitten
vanhempi
commit
a126d535cf

+ 2 - 1
api/core/model_runtime/model_providers/spark/llm/_client.py

@@ -25,6 +25,7 @@ class SparkLLMClient:
             "spark-pro": {"version": "v3.1", "chat_domain": "generalv3"},
             "spark-pro-128k": {"version": "pro-128k", "chat_domain": "pro-128k"},
             "spark-max": {"version": "v3.5", "chat_domain": "generalv3.5"},
+            "spark-max-32k": {"version": "max-32k", "chat_domain": "max-32k"},
             "spark-4.0-ultra": {"version": "v4.0", "chat_domain": "4.0Ultra"},
         }
 
@@ -32,7 +33,7 @@ class SparkLLMClient:
 
         self.chat_domain = model_api_configs[model]["chat_domain"]
 
-        if model == "spark-pro-128k":
+        if model in ["spark-pro-128k", "spark-max-32k"]:
             self.api_base = f"wss://{domain}/{endpoint}/{api_version}"
         else:
             self.api_base = f"wss://{domain}/{api_version}/{endpoint}"

+ 1 - 0
api/core/model_runtime/model_providers/spark/llm/_position.yaml

@@ -1,3 +1,4 @@
+- spark-max-32k
 - spark-4.0-ultra
 - spark-max
 - spark-pro-128k

+ 33 - 0
api/core/model_runtime/model_providers/spark/llm/spark-max-32k.yaml

@@ -0,0 +1,33 @@
+model: spark-max-32k
+label:
+  en_US: Spark Max-32K
+model_type: llm
+model_properties:
+  mode: chat
+parameter_rules:
+  - name: temperature
+    use_template: temperature
+    default: 0.5
+    help:
+      zh_Hans: 核采样阈值。用于决定结果随机性,取值越高随机性越强即相同的问题得到的不同答案的可能性越高。
+      en_US: Kernel sampling threshold. Used to determine the randomness of the results. The higher the value, the stronger the randomness, that is, the higher the possibility of getting different answers to the same question.
+  - name: max_tokens
+    use_template: max_tokens
+    default: 4096
+    min: 1
+    max: 8192
+    help:
+      zh_Hans: 模型回答的tokens的最大长度。
+      en_US: Maximum length of tokens for the model response.
+  - name: top_k
+    label:
+      zh_Hans: 取样数量
+      en_US: Top k
+    type: int
+    default: 4
+    min: 1
+    max: 6
+    help:
+      zh_Hans: 从 k 个候选中随机选择一个(非等概率)。
+      en_US: Randomly select one from k candidates (non-equal probability).
+    required: false