2026-03-17 00:14:01 -07:00
|
|
|
import { definePluginEntry } from "openclaw/plugin-sdk/core";
|
2026-03-16 21:13:56 -07:00
|
|
|
import { createProviderApiKeyAuthMethod } from "openclaw/plugin-sdk/provider-auth";
|
2026-03-16 21:33:50 -07:00
|
|
|
import { buildSingleProviderApiKeyCatalog } from "openclaw/plugin-sdk/provider-catalog";
|
2026-03-16 21:18:16 -07:00
|
|
|
import { applySyntheticConfig, SYNTHETIC_DEFAULT_MODEL_REF } from "./onboard.js";
|
2026-03-16 18:33:07 -07:00
|
|
|
import { buildSyntheticProvider } from "./provider-catalog.js";
|
2026-03-15 16:09:21 -07:00
|
|
|
|
|
|
|
|
const PROVIDER_ID = "synthetic";
|
|
|
|
|
|
2026-03-17 00:14:01 -07:00
|
|
|
export default definePluginEntry({
|
2026-03-15 16:09:21 -07:00
|
|
|
id: PROVIDER_ID,
|
|
|
|
|
name: "Synthetic Provider",
|
|
|
|
|
description: "Bundled Synthetic provider plugin",
|
2026-03-17 00:14:01 -07:00
|
|
|
register(api) {
|
2026-03-15 16:09:21 -07:00
|
|
|
api.registerProvider({
|
|
|
|
|
id: PROVIDER_ID,
|
|
|
|
|
label: "Synthetic",
|
|
|
|
|
docsPath: "/providers/synthetic",
|
|
|
|
|
envVars: ["SYNTHETIC_API_KEY"],
|
2026-03-15 23:47:07 -07:00
|
|
|
auth: [
|
|
|
|
|
createProviderApiKeyAuthMethod({
|
|
|
|
|
providerId: PROVIDER_ID,
|
|
|
|
|
methodId: "api-key",
|
|
|
|
|
label: "Synthetic API key",
|
|
|
|
|
hint: "Anthropic-compatible (multi-model)",
|
|
|
|
|
optionKey: "syntheticApiKey",
|
|
|
|
|
flagName: "--synthetic-api-key",
|
|
|
|
|
envVar: "SYNTHETIC_API_KEY",
|
|
|
|
|
promptMessage: "Enter Synthetic API key",
|
|
|
|
|
defaultModel: SYNTHETIC_DEFAULT_MODEL_REF,
|
|
|
|
|
expectedProviders: ["synthetic"],
|
|
|
|
|
applyConfig: (cfg) => applySyntheticConfig(cfg),
|
|
|
|
|
wizard: {
|
|
|
|
|
choiceId: "synthetic-api-key",
|
|
|
|
|
choiceLabel: "Synthetic API key",
|
|
|
|
|
groupId: "synthetic",
|
|
|
|
|
groupLabel: "Synthetic",
|
|
|
|
|
groupHint: "Anthropic-compatible (multi-model)",
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
],
|
2026-03-15 16:09:21 -07:00
|
|
|
catalog: {
|
|
|
|
|
order: "simple",
|
2026-03-17 04:03:07 +00:00
|
|
|
run: (ctx) =>
|
|
|
|
|
buildSingleProviderApiKeyCatalog({
|
|
|
|
|
ctx,
|
|
|
|
|
providerId: PROVIDER_ID,
|
|
|
|
|
buildProvider: buildSyntheticProvider,
|
|
|
|
|
}),
|
2026-03-15 16:09:21 -07:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
},
|
2026-03-17 00:14:01 -07:00
|
|
|
});
|