Squashed 'third_party/pi/' content from commit d981de122
git-subtree-dir: third_party/pi git-subtree-split: d981de1229ef899957bbe968bc8dcda02a21f477
This commit is contained in:
18
packages/ai/test/openrouter-cache-control-models.test.ts
Normal file
18
packages/ai/test/openrouter-cache-control-models.test.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { getModel } from "../src/compat.ts";
|
||||
|
||||
const OPENROUTER_ANTHROPIC_LATEST_MODEL_IDS = [
|
||||
"~anthropic/claude-fable-latest",
|
||||
"~anthropic/claude-haiku-latest",
|
||||
"~anthropic/claude-opus-latest",
|
||||
"~anthropic/claude-sonnet-latest",
|
||||
] as const;
|
||||
|
||||
describe("OpenRouter Anthropic latest alias metadata", () => {
|
||||
it.each(OPENROUTER_ANTHROPIC_LATEST_MODEL_IDS)("keeps completions cache control for %s", (modelId) => {
|
||||
const model = getModel("openrouter", modelId);
|
||||
expect(model.api).toBe("openai-completions");
|
||||
if (model.api !== "openai-completions") throw new Error(`Unexpected API for ${modelId}`);
|
||||
expect(model.compat?.cacheControlFormat).toBe("anthropic");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user