feat: add OpenRouter API client with free model support
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { OpenRouterClient } from "../openrouter";
|
||||
|
||||
describe("OpenRouterClient", () => {
|
||||
it("should create instance with API key", () => {
|
||||
const client = new OpenRouterClient("test-api-key");
|
||||
expect(client).toBeInstanceOf(OpenRouterClient);
|
||||
});
|
||||
|
||||
it("should have default free models list", () => {
|
||||
const client = new OpenRouterClient("test-api-key");
|
||||
const models = client.getFreeModels();
|
||||
expect(models).toContain("google/gemini-2.0-flash-exp:free");
|
||||
});
|
||||
|
||||
it("should have available model providers", () => {
|
||||
const client = new OpenRouterClient("test-api-key");
|
||||
const providers = client.getProviders();
|
||||
expect(providers).toContain("openai");
|
||||
expect(providers).toContain("google");
|
||||
expect(providers).toContain("anthropic");
|
||||
expect(providers).toContain("deepseek");
|
||||
expect(providers).toContain("meta");
|
||||
expect(providers).toContain("xai");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user