request-capabilities.test.ts 633 B

12345678910111213
  1. import { expect, it } from "vitest";
  2. import { resolveModelRequestCapabilities } from "../src/model/tool-search.js";
  3. it.each([
  4. ["anthropic-messages", true],
  5. ["openai-chat-completions", false],
  6. ["openai-responses", false],
  7. ])("uses the Anthropic request shape only on the Anthropic protocol (%s)", (apiType, anthropic) => {
  8. const capabilities = resolveModelRequestCapabilities(apiType, { type: "api-key" });
  9. expect(capabilities.foldRemindersIntoToolResults).toBe(anthropic);
  10. expect(capabilities.dropReasoningOnlyOrBlankAssistants).toBe(anthropic);
  11. expect(capabilities.toolSearch?.protocolSupported).toBe(anthropic);
  12. });