mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Route eligible OpenRouter Claude models through the native Messages API and surface provider thinking-drop diagnostics.
18 lines
722 B
TypeScript
18 lines
722 B
TypeScript
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");
|
|
});
|
|
});
|