mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-09 00:01:17 +00:00
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
import {
|
|
mergeImplicitAnthropicVertexProvider,
|
|
resolveAnthropicVertexConfigApiKey,
|
|
resolveImplicitAnthropicVertexProvider,
|
|
} from "./api.js";
|
|
|
|
const PROVIDER_ID = "anthropic-vertex";
|
|
|
|
export default definePluginEntry({
|
|
id: PROVIDER_ID,
|
|
name: "Anthropic Vertex Provider",
|
|
description: "Bundled Anthropic Vertex provider plugin",
|
|
register(api) {
|
|
api.registerProvider({
|
|
id: PROVIDER_ID,
|
|
label: "Anthropic Vertex",
|
|
docsPath: "/providers/models",
|
|
auth: [],
|
|
catalog: {
|
|
order: "simple",
|
|
run: async (ctx) => {
|
|
const implicit = await resolveImplicitAnthropicVertexProvider({
|
|
env: ctx.env,
|
|
});
|
|
if (!implicit) {
|
|
return null;
|
|
}
|
|
return {
|
|
provider: mergeImplicitAnthropicVertexProvider({
|
|
existing: ctx.config.models?.providers?.[PROVIDER_ID],
|
|
implicit,
|
|
}),
|
|
};
|
|
},
|
|
},
|
|
resolveConfigApiKey: ({ env }) => resolveAnthropicVertexConfigApiKey(env),
|
|
capabilities: {
|
|
providerFamily: "anthropic",
|
|
dropThinkingBlockModelHints: ["claude"],
|
|
},
|
|
});
|
|
},
|
|
});
|