test: fix rebase fallout
This commit is contained in:
parent
9ebe38b6e3
commit
70da383a61
@ -4,8 +4,8 @@ import {
|
||||
createKilocodeWrapper,
|
||||
isProxyReasoningUnsupported,
|
||||
} from "openclaw/plugin-sdk/provider-stream";
|
||||
import { applyKilocodeConfig, KILOCODE_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyKilocodeConfig, KILOCODE_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildKilocodeProviderWithDiscovery } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "kilocode";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { applyQianfanConfig, QIANFAN_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyQianfanConfig, QIANFAN_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildQianfanProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "qianfan";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { applySyntheticConfig, SYNTHETIC_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applySyntheticConfig, SYNTHETIC_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSyntheticProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "synthetic";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { applyTogetherConfig, TOGETHER_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyTogetherConfig, TOGETHER_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildTogetherProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "together";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { applyVeniceConfig, VENICE_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyVeniceConfig, VENICE_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildVeniceProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "venice";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { applyVercelAiGatewayConfig, VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyVercelAiGatewayConfig, VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildVercelAiGatewayProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "vercel-ai-gateway";
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { emptyPluginConfigSchema, type OpenClawPluginApi } from "openclaw/plugin-sdk/core";
|
||||
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
||||
import { PROVIDER_LABELS } from "openclaw/plugin-sdk/provider-usage";
|
||||
import { applyXiaomiConfig, XIAOMI_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildSingleProviderApiKeyCatalog } from "../../src/plugins/provider-catalog.js";
|
||||
import { applyXiaomiConfig, XIAOMI_DEFAULT_MODEL_REF } from "./onboard.js";
|
||||
import { buildXiaomiProvider } from "./provider-catalog.js";
|
||||
|
||||
const PROVIDER_ID = "xiaomi";
|
||||
|
||||
@ -7,6 +7,15 @@ import {
|
||||
} from "./provider-catalog.js";
|
||||
import type { ProviderCatalogContext } from "./types.js";
|
||||
|
||||
function createProviderConfig(params?: { provider?: string; baseUrl?: string }) {
|
||||
return {
|
||||
api: "openai-completions" as const,
|
||||
provider: params?.provider ?? "test-provider",
|
||||
baseUrl: params?.baseUrl ?? "https://default.example/v1",
|
||||
models: [],
|
||||
};
|
||||
}
|
||||
|
||||
function createCatalogContext(params: {
|
||||
config?: OpenClawConfig;
|
||||
apiKeys?: Record<string, string | undefined>;
|
||||
@ -38,7 +47,7 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
const result = await buildSingleProviderApiKeyCatalog({
|
||||
ctx: createCatalogContext({}),
|
||||
providerId: "test-provider",
|
||||
buildProvider: () => ({ api: "openai-completions", provider: "test-provider" }),
|
||||
buildProvider: () => createProviderConfig(),
|
||||
});
|
||||
|
||||
expect(result).toBeNull();
|
||||
@ -50,12 +59,14 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
apiKeys: { "test-provider": "secret-key" },
|
||||
}),
|
||||
providerId: "test-provider",
|
||||
buildProvider: async () => ({ api: "openai-completions", provider: "test-provider" }),
|
||||
buildProvider: async () => createProviderConfig(),
|
||||
});
|
||||
|
||||
expect(result).toEqual({
|
||||
provider: {
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://default.example/v1",
|
||||
models: [],
|
||||
provider: "test-provider",
|
||||
apiKey: "secret-key",
|
||||
},
|
||||
@ -71,6 +82,7 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
providers: {
|
||||
"test-provider": {
|
||||
baseUrl: " https://override.example/v1/ ",
|
||||
models: [],
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -78,8 +90,7 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
}),
|
||||
providerId: "test-provider",
|
||||
buildProvider: () => ({
|
||||
api: "openai-completions",
|
||||
provider: "test-provider",
|
||||
...createProviderConfig(),
|
||||
baseUrl: "https://default.example/v1",
|
||||
}),
|
||||
allowExplicitBaseUrl: true,
|
||||
@ -88,8 +99,9 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
expect(result).toEqual({
|
||||
provider: {
|
||||
api: "openai-completions",
|
||||
provider: "test-provider",
|
||||
baseUrl: "https://override.example/v1/",
|
||||
models: [],
|
||||
provider: "test-provider",
|
||||
apiKey: "secret-key",
|
||||
},
|
||||
});
|
||||
@ -102,8 +114,8 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
}),
|
||||
providerId: "test-provider",
|
||||
buildProviders: async () => ({
|
||||
alpha: { api: "openai-completions", provider: "alpha" },
|
||||
beta: { api: "openai-completions", provider: "beta" },
|
||||
alpha: createProviderConfig({ provider: "alpha" }),
|
||||
beta: createProviderConfig({ provider: "beta" }),
|
||||
}),
|
||||
});
|
||||
|
||||
@ -111,11 +123,15 @@ describe("buildSingleProviderApiKeyCatalog", () => {
|
||||
providers: {
|
||||
alpha: {
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://default.example/v1",
|
||||
models: [],
|
||||
provider: "alpha",
|
||||
apiKey: "secret-key",
|
||||
},
|
||||
beta: {
|
||||
api: "openai-completions",
|
||||
baseUrl: "https://default.example/v1",
|
||||
models: [],
|
||||
provider: "beta",
|
||||
apiKey: "secret-key",
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user