llm-simple-router 0.9.16 → 0.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -84,6 +84,10 @@ export const OVERFLOW_THRESHOLD = 1000000;
|
|
|
84
84
|
export function lookupContextWindow(modelName) {
|
|
85
85
|
return MODEL_CONTEXT_WINDOWS[modelName] ?? DEFAULT_CONTEXT_WINDOW;
|
|
86
86
|
}
|
|
87
|
+
/** 标准化 patch 名称:连字符 → 下划线 */
|
|
88
|
+
function normalizePatchName(name) {
|
|
89
|
+
return name.replace(/-/g, "_");
|
|
90
|
+
}
|
|
87
91
|
export function parseModels(raw) {
|
|
88
92
|
if (!raw)
|
|
89
93
|
return [];
|
|
@@ -100,7 +104,7 @@ export function parseModels(raw) {
|
|
|
100
104
|
return null;
|
|
101
105
|
return {
|
|
102
106
|
name: obj.name,
|
|
103
|
-
patches: obj.patches ?? [],
|
|
107
|
+
patches: (obj.patches ?? []).map(normalizePatchName),
|
|
104
108
|
};
|
|
105
109
|
}).filter((e) => e !== null);
|
|
106
110
|
}
|
package/package.json
CHANGED