mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 18:02:28 +00:00
The automated rebrand sed script replaced "OpenClaw" with "Hanzo Bot" (with space) instead of "HanzoBot" in 8,315 TypeScript identifier occurrences across 1,632 files. This fixes all broken class names, type names, function names, and variable names. Co-authored-by: Hanzo Dev <[email protected]>
90 lines
2.8 KiB
TypeScript
90 lines
2.8 KiB
TypeScript
import {
|
|
VLLM_DEFAULT_API_KEY_ENV_VAR,
|
|
VLLM_DEFAULT_BASE_URL,
|
|
VLLM_MODEL_PLACEHOLDER,
|
|
VLLM_PROVIDER_LABEL,
|
|
} from "openclaw/plugin-sdk/agent-runtime";
|
|
import {
|
|
definePluginEntry,
|
|
type HanzoBotPluginApi,
|
|
type ProviderAuthMethodNonInteractiveContext,
|
|
} from "openclaw/plugin-sdk/core";
|
|
|
|
const PROVIDER_ID = "vllm";
|
|
|
|
async function loadProviderSetup() {
|
|
return await import("openclaw/plugin-sdk/self-hosted-provider-setup");
|
|
}
|
|
|
|
export default definePluginEntry({
|
|
id: "vllm",
|
|
name: "vLLM Provider",
|
|
description: "Bundled vLLM provider plugin",
|
|
register(api: HanzoBotPluginApi) {
|
|
api.registerProvider({
|
|
id: PROVIDER_ID,
|
|
label: "vLLM",
|
|
docsPath: "/providers/vllm",
|
|
envVars: ["VLLM_API_KEY"],
|
|
auth: [
|
|
{
|
|
id: "custom",
|
|
label: VLLM_PROVIDER_LABEL,
|
|
hint: "Local/self-hosted OpenAI-compatible server",
|
|
kind: "custom",
|
|
run: async (ctx) => {
|
|
const providerSetup = await loadProviderSetup();
|
|
return await providerSetup.promptAndConfigureOpenAICompatibleSelfHostedProviderAuth({
|
|
cfg: ctx.config,
|
|
prompter: ctx.prompter,
|
|
providerId: PROVIDER_ID,
|
|
providerLabel: VLLM_PROVIDER_LABEL,
|
|
defaultBaseUrl: VLLM_DEFAULT_BASE_URL,
|
|
defaultApiKeyEnvVar: VLLM_DEFAULT_API_KEY_ENV_VAR,
|
|
modelPlaceholder: VLLM_MODEL_PLACEHOLDER,
|
|
});
|
|
},
|
|
runNonInteractive: async (ctx: ProviderAuthMethodNonInteractiveContext) => {
|
|
const providerSetup = await loadProviderSetup();
|
|
return await providerSetup.configureOpenAICompatibleSelfHostedProviderNonInteractive({
|
|
ctx,
|
|
providerId: PROVIDER_ID,
|
|
providerLabel: VLLM_PROVIDER_LABEL,
|
|
defaultBaseUrl: VLLM_DEFAULT_BASE_URL,
|
|
defaultApiKeyEnvVar: VLLM_DEFAULT_API_KEY_ENV_VAR,
|
|
modelPlaceholder: VLLM_MODEL_PLACEHOLDER,
|
|
});
|
|
},
|
|
},
|
|
],
|
|
discovery: {
|
|
order: "late",
|
|
run: async (ctx) => {
|
|
const providerSetup = await loadProviderSetup();
|
|
return await providerSetup.discoverOpenAICompatibleSelfHostedProvider({
|
|
ctx,
|
|
providerId: PROVIDER_ID,
|
|
buildProvider: providerSetup.buildVllmProvider,
|
|
});
|
|
},
|
|
},
|
|
wizard: {
|
|
setup: {
|
|
choiceId: "vllm",
|
|
choiceLabel: "vLLM",
|
|
choiceHint: "Local/self-hosted OpenAI-compatible server",
|
|
groupId: "vllm",
|
|
groupLabel: "vLLM",
|
|
groupHint: "Local/self-hosted OpenAI-compatible",
|
|
methodId: "custom",
|
|
},
|
|
modelPicker: {
|
|
label: "vLLM (custom)",
|
|
hint: "Enter vLLM URL + API key + model",
|
|
methodId: "custom",
|
|
},
|
|
},
|
|
});
|
|
},
|
|
});
|