Files
OmniRoute/tests/unit/multimodal-embeddings-alias.test.ts
Ravi Tharuma c767494ae4 feat(api): alias /v1/multimodal-embeddings to /v1/embeddings (#10568)
Jina-compatible clients POST /v1/multimodal-embeddings and currently get
HTTP 404 unknown_route from the catch-all.

Co-authored-by: Ravi Tharuma <RaviTharuma@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 10:52:24 -03:00

17 lines
672 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
process.env.DATA_DIR = mkdtempSync(join(tmpdir(), "omniroute-mm-embed-alias-"));
const embeddings = await import("../../src/app/api/v1/embeddings/route.ts");
const multimodal = await import("../../src/app/api/v1/multimodal-embeddings/route.ts");
test("POST/GET/OPTIONS /v1/multimodal-embeddings are the embeddings handlers", () => {
assert.equal(multimodal.POST, embeddings.POST);
assert.equal(multimodal.GET, embeddings.GET);
assert.equal(multimodal.OPTIONS, embeddings.OPTIONS);
});