mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 00:02:20 +03:00
feat(providers): add Requesty as an OpenAI-compatible gateway provider (#6120). Fixed the APIKEY_PROVIDERS count guard (167→168) the feature had missed. TDD guard requesty-provider.test.ts (4/4) + providers-constants-split (4/4). Base-reds only. Integrated into release/v3.8.45. (thanks @chirag127)
46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
import test from "node:test";
|
|
import assert from "node:assert/strict";
|
|
|
|
const { APIKEY_PROVIDERS } = await import("../../src/shared/constants/providers.ts");
|
|
const { REGISTRY: providerRegistry } = await import("../../open-sse/config/providerRegistry.ts");
|
|
const { isValidModel } = await import("../../src/shared/constants/models.ts");
|
|
|
|
const REQUESTY_CHAT_URL = "https://router.requesty.ai/v1/chat/completions";
|
|
const REQUESTY_MODELS_URL = "https://router.requesty.ai/v1/models";
|
|
|
|
test("requesty is registered as an API-key gateway provider", () => {
|
|
const entry = APIKEY_PROVIDERS.requesty;
|
|
assert.ok(entry, "APIKEY_PROVIDERS.requesty must be defined");
|
|
assert.equal(entry.id, "requesty");
|
|
assert.equal(entry.alias, "requesty");
|
|
assert.equal(entry.name, "Requesty");
|
|
assert.equal(entry.website, "https://requesty.ai");
|
|
assert.equal(entry.passthroughModels, true);
|
|
assert.equal(entry.hasFree, true);
|
|
});
|
|
|
|
test("requesty registry entry uses OpenAI format with bearer API-key auth", () => {
|
|
const entry = providerRegistry.requesty;
|
|
assert.ok(entry, "providerRegistry.requesty must be defined");
|
|
assert.equal(entry.id, "requesty");
|
|
assert.equal(entry.alias, "requesty");
|
|
assert.equal(entry.format, "openai");
|
|
assert.equal(entry.executor, "default");
|
|
assert.equal(entry.authType, "apikey");
|
|
assert.equal(entry.authHeader, "bearer");
|
|
assert.equal(entry.baseUrl, REQUESTY_CHAT_URL);
|
|
assert.equal(entry.modelsUrl, REQUESTY_MODELS_URL);
|
|
assert.equal(entry.passthroughModels, true);
|
|
});
|
|
|
|
test("requesty ships no static model seed — relies fully on passthrough + live catalog", () => {
|
|
assert.deepEqual(providerRegistry.requesty.models, []);
|
|
});
|
|
|
|
test("requesty accepts any model id via passthrough (GPT/Claude/Gemini/Kimi behind one key)", () => {
|
|
assert.equal(isValidModel("requesty", "openai/gpt-5.2"), true);
|
|
assert.equal(isValidModel("requesty", "anthropic/claude-opus-4-5"), true);
|
|
assert.equal(isValidModel("requesty", "google/gemini-3-pro"), true);
|
|
assert.equal(isValidModel("requesty", "coding/gpt-4o-mini"), true);
|
|
});
|