mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 02:06:43 +00:00
fix(chutes): report cache-read pricing from live catalog (#111253)
This commit is contained in:
@@ -187,7 +187,7 @@ describe("chutes-models", () => {
|
||||
input_modalities: ["text", "image"],
|
||||
context_length: 200000,
|
||||
max_output_length: 16384,
|
||||
pricing: { prompt: 0.1, completion: 0.2 },
|
||||
pricing: { prompt: 0.1, completion: 0.2, input_cache_read: 0.05 },
|
||||
},
|
||||
{ id: "new-provider/simple-model" },
|
||||
],
|
||||
@@ -201,6 +201,12 @@ describe("chutes-models", () => {
|
||||
const secondModel = requireChutesModel(models, 1);
|
||||
expect(firstModel.id).toBe("zai-org/GLM-5-TEE");
|
||||
expect(secondModel.reasoning).toBe(true);
|
||||
expect(secondModel.cost).toEqual({
|
||||
input: 0.1,
|
||||
output: 0.2,
|
||||
cacheRead: 0.05,
|
||||
cacheWrite: 0,
|
||||
});
|
||||
if (!secondModel.compat) {
|
||||
throw new Error("expected Chutes API model compat");
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ interface ChutesModelEntry {
|
||||
pricing?: {
|
||||
prompt?: number;
|
||||
completion?: number;
|
||||
input_cache_read?: number;
|
||||
};
|
||||
[key: string]: unknown;
|
||||
}
|
||||
@@ -127,7 +128,7 @@ export async function discoverChutesModels(accessToken?: string): Promise<ModelD
|
||||
cost: {
|
||||
input: entry.pricing?.prompt || 0,
|
||||
output: entry.pricing?.completion || 0,
|
||||
cacheRead: 0,
|
||||
cacheRead: entry.pricing?.input_cache_read || 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: asPositiveSafeInteger(entry.context_length) ?? CHUTES_DEFAULT_CONTEXT_WINDOW,
|
||||
|
||||
Reference in New Issue
Block a user