feat: add v1m System One provider
This commit is contained in:
1 parent
e78b766a20
commit
0a879c5cd3
6 files changed
+66
-3
No files matched your search
@@ -19,7 +19,8 @@ export async function handleSystemoneCore({
|
|||||||
}) {
|
}) {
|
||||||
const { provider, model } = modelInfo;
|
const { provider, model } = modelInfo;
|
||||||
const cfg = PROVIDER_MEDIA[provider]?.systemoneConfig;
|
const cfg = PROVIDER_MEDIA[provider]?.systemoneConfig;
|
||||||
if (!cfg?.baseUrl) {
|
const targetUrl = credentials?.providerSpecificData?.baseUrl || cfg?.baseUrl;
|
||||||
|
if (!targetUrl) {
|
||||||
return createErrorResult(
|
return createErrorResult(
|
||||||
HTTP_STATUS.BAD_REQUEST,
|
HTTP_STATUS.BAD_REQUEST,
|
||||||
`Provider '${provider}' does not support System One.`
|
`Provider '${provider}' does not support System One.`
|
||||||
@@ -49,7 +50,7 @@ export async function handleSystemoneCore({
|
|||||||
|
|
||||||
let providerResponse;
|
let providerResponse;
|
||||||
try {
|
try {
|
||||||
providerResponse = await fetch(cfg.baseUrl, {
|
providerResponse = await fetch(targetUrl, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers,
|
headers,
|
||||||
body: JSON.stringify(requestBody),
|
body: JSON.stringify(requestBody),
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ import p127 from "./atria.js";
|
|||||||
import p129 from "./agnes.js";
|
import p129 from "./agnes.js";
|
||||||
import p130 from "./bai.js";
|
import p130 from "./bai.js";
|
||||||
import p131 from "./tinyfish.js";
|
import p131 from "./tinyfish.js";
|
||||||
|
import p132 from "./v1m.js";
|
||||||
export default [
|
export default [
|
||||||
p0,
|
p0,
|
||||||
p1,
|
p1,
|
||||||
@@ -262,4 +263,5 @@ export default [
|
|||||||
p129,
|
p129,
|
||||||
p130,
|
p130,
|
||||||
p131,
|
p131,
|
||||||
|
p132,
|
||||||
];
|
];
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
export default {
|
||||||
|
id: "v1m",
|
||||||
|
priority: 45,
|
||||||
|
alias: "v1m",
|
||||||
|
aliases: ["systemone", "jev"],
|
||||||
|
uiAlias: "v1m",
|
||||||
|
display: {
|
||||||
|
name: "v1m (System One)",
|
||||||
|
icon: "psychology",
|
||||||
|
color: "#6366F1",
|
||||||
|
textIcon: "V1",
|
||||||
|
website: "https://v1m.ir",
|
||||||
|
notice: {
|
||||||
|
text: "v1m System One calibrated decision engine. Fast probabilistic evaluations over state and questions.",
|
||||||
|
apiKeyUrl: "https://v1m.ir",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
category: "apikey",
|
||||||
|
authType: "apikey",
|
||||||
|
hasProviderSpecificData: true,
|
||||||
|
models: [
|
||||||
|
{ id: "rev-latest", name: "v1m Rev Latest (Calibrated)", kind: "systemone" },
|
||||||
|
{ id: "v1m-decision-engine", name: "v1m Decision Engine", kind: "systemone" },
|
||||||
|
],
|
||||||
|
serviceKinds: ["systemone"],
|
||||||
|
systemoneConfig: {
|
||||||
|
baseUrl: "https://v1m.ir/v1/systemone",
|
||||||
|
authType: "apikey",
|
||||||
|
authHeader: "bearer",
|
||||||
|
},
|
||||||
|
};
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@@ -1,6 +1,6 @@
|
|||||||
// Provider definitions
|
// Provider definitions
|
||||||
import REGISTRY from "open-sse/providers/registry/index.js";
|
import REGISTRY from "open-sse/providers/registry/index.js";
|
||||||
import { RISK_NOTICE } from "@/shared/constants/providersDisplay";
|
import { RISK_NOTICE } from "@/shared/constants/providersDisplay.js";
|
||||||
|
|
||||||
const MEDIA_ENTRY_KEYS = [
|
const MEDIA_ENTRY_KEYS = [
|
||||||
"serviceKinds", "ttsConfig", "sttConfig", "embeddingConfig",
|
"serviceKinds", "ttsConfig", "sttConfig", "embeddingConfig",
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
import REGISTRY from "../../open-sse/providers/registry/index.js";
|
||||||
|
import { PROVIDER_MEDIA } from "../../open-sse/providers/index.js";
|
||||||
|
import { AI_PROVIDERS, getProvidersByKind } from "@/shared/constants/providers";
|
||||||
|
|
||||||
|
describe("v1m System One provider", () => {
|
||||||
|
const entry = REGISTRY.find((e) => e.id === "v1m");
|
||||||
|
|
||||||
|
it("is registered as a System One apikey provider", () => {
|
||||||
|
expect(entry).toBeDefined();
|
||||||
|
expect(entry.category).toBe("apikey");
|
||||||
|
expect(entry.serviceKinds).toEqual(["systemone"]);
|
||||||
|
expect(PROVIDER_MEDIA["v1m"]?.systemoneConfig?.baseUrl).toBe("https://v1m.ir/v1/systemone");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("appears in getProvidersByKind('systemone')", () => {
|
||||||
|
const list = getProvidersByKind("systemone");
|
||||||
|
const found = list.find((p) => p.id === "v1m");
|
||||||
|
expect(found).toBeDefined();
|
||||||
|
expect(found.alias).toBe("v1m");
|
||||||
|
expect(found.systemoneConfig?.baseUrl).toBe("https://v1m.ir/v1/systemone");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("exposes calibrated models", () => {
|
||||||
|
const ids = (entry.models || []).map((m) => m.id);
|
||||||
|
expect(ids).toContain("rev-latest");
|
||||||
|
expect(ids).toContain("v1m-decision-engine");
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in new issue
Block a user