feat(agnes): seed the 2.5/3.0 model ids in the registry
This commit is contained in:
1 parent
0bc7f86e4b
commit
2310ad4b14
2 files changed
+51
-2
No files matched your search
@@ -23,7 +23,16 @@ export default {
|
||||
baseUrl: "https://apihub.agnes-ai.com/v1/chat/completions",
|
||||
validateUrl: "https://apihub.agnes-ai.com/v1/models",
|
||||
},
|
||||
// No model ids could be verified without a key, so discovery is left to the
|
||||
// live endpoint and any id is accepted through passthroughModels.
|
||||
// Seeds so the dashboard has something to show before a key is saved and
|
||||
// /v1/models answers with a usable list. The live catalogue at
|
||||
// apihub.agnes-ai.com/v1/models requires a token (401 "Token not provided"),
|
||||
// so these ids are a curated starting set rather than a verified dump —
|
||||
// passthroughModels below still accepts any id the account actually has.
|
||||
models: [
|
||||
{ id: "agnes-2.5-flash", name: "Agnes 2.5 Flash" },
|
||||
{ id: "agnes-2.5-pro", name: "Agnes 2.5 Pro" },
|
||||
{ id: "agnes-2.5-pro-beta", name: "Agnes 2.5 Pro Beta" },
|
||||
{ id: "agnes-3.0-flash", name: "Agnes 3.0 Flash" },
|
||||
],
|
||||
passthroughModels: true,
|
||||
};
|
||||
@@ -0,0 +1,40 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import agnes from "../../open-sse/providers/registry/agnes.js";
|
||||
|
||||
// Seeds for Agnes AI. The live catalogue (apihub.agnes-ai.com/v1/models)
|
||||
// answers 401 without a token, so these ids are a curated starting set and
|
||||
// passthroughModels still accepts anything the account actually has.
|
||||
|
||||
describe("agnes registry model seeds", () => {
|
||||
it("declares the four 2.5/3.0 models", () => {
|
||||
expect(agnes.models.map((m) => m.id)).toEqual([
|
||||
"agnes-2.5-flash",
|
||||
"agnes-2.5-pro",
|
||||
"agnes-2.5-pro-beta",
|
||||
"agnes-3.0-flash",
|
||||
]);
|
||||
});
|
||||
|
||||
it("gives every model a display name", () => {
|
||||
for (const m of agnes.models) {
|
||||
expect(typeof m.name, m.id).toBe("string");
|
||||
expect(m.name.length, m.id).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
|
||||
it("keeps passthroughModels so newer ids still work", () => {
|
||||
expect(agnes.passthroughModels).toBe(true);
|
||||
});
|
||||
|
||||
it("does not claim a modelsFetcher for an endpoint that needs a token", () => {
|
||||
// /v1/models returns 401 "Token not provided" without auth, so a public
|
||||
// modelsFetcher would just surface an error instead of a list.
|
||||
expect(agnes.modelsFetcher).toBeUndefined();
|
||||
});
|
||||
|
||||
it("leaves transport untouched", () => {
|
||||
expect(agnes.transport.baseUrl).toBe("https://apihub.agnes-ai.com/v1/chat/completions");
|
||||
expect(agnes.transport.validateUrl).toBe("https://apihub.agnes-ai.com/v1/models");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user