mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 11:01:24 +00:00
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 0e7f84a2a1
Co-authored-by: lailoo <20536249+lailoo@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
27 lines
986 B
TypeScript
27 lines
986 B
TypeScript
import { mkdtempSync } from "node:fs";
|
|
import { tmpdir } from "node:os";
|
|
import { join } from "node:path";
|
|
import { describe, expect, it } from "vitest";
|
|
import { resolveImplicitProviders } from "./models-config.providers.js";
|
|
|
|
describe("MiniMax implicit provider (#15275)", () => {
|
|
it("should use anthropic-messages API for API-key provider", async () => {
|
|
const agentDir = mkdtempSync(join(tmpdir(), "openclaw-test-"));
|
|
const previous = process.env.MINIMAX_API_KEY;
|
|
process.env.MINIMAX_API_KEY = "test-key";
|
|
|
|
try {
|
|
const providers = await resolveImplicitProviders({ agentDir });
|
|
expect(providers?.minimax).toBeDefined();
|
|
expect(providers?.minimax?.api).toBe("anthropic-messages");
|
|
expect(providers?.minimax?.baseUrl).toBe("https://api.minimax.io/anthropic");
|
|
} finally {
|
|
if (previous === undefined) {
|
|
delete process.env.MINIMAX_API_KEY;
|
|
} else {
|
|
process.env.MINIMAX_API_KEY = previous;
|
|
}
|
|
}
|
|
});
|
|
});
|