mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-17 11:20:37 +09:00
Adding support for pi-local
This commit is contained in:
parent
ffc59f5b08
commit
eb7f690ceb
25 changed files with 1861 additions and 12 deletions
33
packages/adapters/pi-local/src/server/models.test.ts
Normal file
33
packages/adapters/pi-local/src/server/models.test.ts
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import { afterEach, describe, expect, it } from "vitest";
|
||||
import {
|
||||
ensurePiModelConfiguredAndAvailable,
|
||||
listPiModels,
|
||||
resetPiModelsCacheForTests,
|
||||
} from "./models.js";
|
||||
|
||||
describe("pi models", () => {
|
||||
afterEach(() => {
|
||||
delete process.env.PAPERCLIP_PI_COMMAND;
|
||||
resetPiModelsCacheForTests();
|
||||
});
|
||||
|
||||
it("returns an empty list when discovery command is unavailable", async () => {
|
||||
process.env.PAPERCLIP_PI_COMMAND = "__paperclip_missing_pi_command__";
|
||||
await expect(listPiModels()).resolves.toEqual([]);
|
||||
});
|
||||
|
||||
it("rejects when model is missing", async () => {
|
||||
await expect(
|
||||
ensurePiModelConfiguredAndAvailable({ model: "" }),
|
||||
).rejects.toThrow("Pi requires `adapterConfig.model`");
|
||||
});
|
||||
|
||||
it("rejects when discovery cannot run for configured model", async () => {
|
||||
process.env.PAPERCLIP_PI_COMMAND = "__paperclip_missing_pi_command__";
|
||||
await expect(
|
||||
ensurePiModelConfiguredAndAvailable({
|
||||
model: "xai/grok-4",
|
||||
}),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue