mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:10:43 +00:00
fix: require complete model catalog pricing tiers
This commit is contained in:
@@ -508,6 +508,8 @@ describe("loadPluginManifestRegistry", () => {
|
||||
{
|
||||
input: 0.6,
|
||||
output: 2.5,
|
||||
cacheRead: 0.15,
|
||||
cacheWrite: 0.6,
|
||||
range: [0, 256000],
|
||||
},
|
||||
],
|
||||
@@ -582,6 +584,8 @@ describe("loadPluginManifestRegistry", () => {
|
||||
{
|
||||
input: 0.6,
|
||||
output: 2.5,
|
||||
cacheRead: 0.15,
|
||||
cacheWrite: 0.6,
|
||||
range: [0, 256000],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -717,7 +717,15 @@ function normalizeModelCatalogTieredCost(
|
||||
}
|
||||
const input = normalizeModelCatalogNumber(entry.input);
|
||||
const output = normalizeModelCatalogNumber(entry.output);
|
||||
if (input === undefined || output === undefined || !Array.isArray(entry.range)) {
|
||||
const cacheRead = normalizeModelCatalogNumber(entry.cacheRead);
|
||||
const cacheWrite = normalizeModelCatalogNumber(entry.cacheWrite);
|
||||
if (
|
||||
input === undefined ||
|
||||
output === undefined ||
|
||||
cacheRead === undefined ||
|
||||
cacheWrite === undefined ||
|
||||
!Array.isArray(entry.range)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
const rangeValues = entry.range
|
||||
@@ -732,13 +740,11 @@ function normalizeModelCatalogTieredCost(
|
||||
if (!range) {
|
||||
continue;
|
||||
}
|
||||
const cacheRead = normalizeModelCatalogNumber(entry.cacheRead);
|
||||
const cacheWrite = normalizeModelCatalogNumber(entry.cacheWrite);
|
||||
normalized.push({
|
||||
input,
|
||||
output,
|
||||
...(cacheRead !== undefined ? { cacheRead } : {}),
|
||||
...(cacheWrite !== undefined ? { cacheWrite } : {}),
|
||||
cacheRead,
|
||||
cacheWrite,
|
||||
range,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user