gemini-embedcontent-format.test.ts 874 B

12345678910111213141516171819202122
  1. import { describe, expect, it } from "vitest";
  2. import { detectFormatByEndpoint } from "@/app/v1/_lib/proxy/format-mapper";
  3. describe("detectFormatByEndpoint - Gemini embedContent", () => {
  4. it.each([
  5. "/v1beta/models/gemini-2.5-flash:embedContent",
  6. "/v1/publishers/google/models/gemini-2.5-pro:embedContent",
  7. ])('returns "gemini" for %s', (pathname) => {
  8. expect(detectFormatByEndpoint(pathname)).toBe("gemini");
  9. });
  10. it.each([
  11. "/v1beta/models/gemini-2.5-flash:unknownAction",
  12. "/v1/publishers/google/models/gemini-2.5-pro:unknownAction",
  13. ])("returns null for unknown Gemini actions: %s", (pathname) => {
  14. expect(detectFormatByEndpoint(pathname)).toBeNull();
  15. });
  16. it("does not classify internal embedContent as gemini-cli", () => {
  17. expect(detectFormatByEndpoint("/v1internal/models/gemini-2.5-flash:embedContent")).toBeNull();
  18. });
  19. });