mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 15:47:28 +00:00
Adds a Vercel AI Gateway provider thinking-profile resolver for trusted OpenAI and Anthropic upstream refs, preserving catalog compat fallback for unsupported/base-only refs. Includes provider tests, docs, and changelog coverage. Supersedes #41561. Co-authored-by: Zcg2021 <80769518+Zcg2021@users.noreply.github.com>
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
import { applyVercelAiGatewayConfig, VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF } from "./onboard.js";
|
|
import {
|
|
buildStaticVercelAiGatewayProvider,
|
|
buildVercelAiGatewayProvider,
|
|
} from "./provider-catalog.js";
|
|
import { resolveVercelAiGatewayThinkingProfile } from "./thinking.js";
|
|
|
|
const PROVIDER_ID = "vercel-ai-gateway";
|
|
|
|
export default defineSingleProviderPluginEntry({
|
|
id: PROVIDER_ID,
|
|
name: "Vercel AI Gateway Provider",
|
|
description: "Bundled Vercel AI Gateway provider plugin",
|
|
provider: {
|
|
label: "Vercel AI Gateway",
|
|
docsPath: "/providers/vercel-ai-gateway",
|
|
auth: [
|
|
{
|
|
methodId: "api-key",
|
|
label: "Vercel AI Gateway API key",
|
|
hint: "API key",
|
|
optionKey: "aiGatewayApiKey",
|
|
flagName: "--ai-gateway-api-key",
|
|
envVar: "AI_GATEWAY_API_KEY",
|
|
promptMessage: "Enter Vercel AI Gateway API key",
|
|
defaultModel: VERCEL_AI_GATEWAY_DEFAULT_MODEL_REF,
|
|
applyConfig: (cfg) => applyVercelAiGatewayConfig(cfg),
|
|
wizard: {
|
|
choiceId: "ai-gateway-api-key",
|
|
groupId: "ai-gateway",
|
|
},
|
|
},
|
|
],
|
|
catalog: {
|
|
buildProvider: buildVercelAiGatewayProvider,
|
|
buildStaticProvider: buildStaticVercelAiGatewayProvider,
|
|
},
|
|
resolveThinkingProfile: ({ modelId }) => resolveVercelAiGatewayThinkingProfile(modelId),
|
|
},
|
|
});
|