model-transform-deepseek-anthropic.test.ts 776 B

1234567891011121314151617181920212223242526272829
  1. import { describe, expect, it } from "vitest";
  2. import { toAiSdkMessages } from "../src/model/index.js";
  3. describe("Anthropic canonical reasoning replay", () => {
  4. it("does not synthesize thinking for tool-call history without reasoning", () => {
  5. const toolCallId = "call_anthropic_plain";
  6. const messages = toAiSdkMessages(
  7. [
  8. {
  9. role: "assistant",
  10. content: "",
  11. toolCalls: [{ id: toolCallId, name: "Read", input: { file_path: "README.md" } }],
  12. },
  13. ],
  14. {
  15. providerKind: "anthropic",
  16. },
  17. );
  18. expect((messages[0] as any).content).toEqual([
  19. {
  20. type: "tool-call",
  21. toolCallId,
  22. toolName: "Read",
  23. input: { file_path: "README.md" },
  24. },
  25. ]);
  26. });
  27. });