refactor: add non-interactive provider plugin setup

This commit is contained in:
Peter Steinberger
2026-03-13 01:08:29 +00:00
parent bcbf429d6b
commit 87ad1ce9b1
13 changed files with 490 additions and 63 deletions

View File

@@ -4,8 +4,10 @@ import {
ensureOllamaModelPulled,
OLLAMA_DEFAULT_BASE_URL,
promptAndConfigureOllama,
configureOllamaNonInteractive,
type OpenClawPluginApi,
type ProviderAuthContext,
type ProviderAuthMethodNonInteractiveContext,
type ProviderAuthResult,
type ProviderDiscoveryContext,
} from "openclaw/plugin-sdk/core";
@@ -50,6 +52,12 @@ const ollamaPlugin = {
defaultModel: `ollama/${result.defaultModelId}`,
};
},
runNonInteractive: async (ctx: ProviderAuthMethodNonInteractiveContext) =>
configureOllamaNonInteractive({
nextConfig: ctx.config,
opts: ctx.opts,
runtime: ctx.runtime,
}),
},
],
discovery: {

View File

@@ -1,5 +1,5 @@
{
"name": "@openclaw/ollama-provider",
"name": "@openclaw/ollama",
"version": "2026.3.11",
"private": true,
"description": "OpenClaw Ollama provider plugin",

View File

@@ -1,9 +1,11 @@
import {
buildSglangProvider,
configureOpenAICompatibleSelfHostedProviderNonInteractive,
emptyPluginConfigSchema,
promptAndConfigureOpenAICompatibleSelfHostedProvider,
type OpenClawPluginApi,
type ProviderAuthContext,
type ProviderAuthMethodNonInteractiveContext,
type ProviderAuthResult,
type ProviderDiscoveryContext,
} from "openclaw/plugin-sdk/core";
@@ -49,6 +51,15 @@ const sglangPlugin = {
defaultModel: result.modelRef,
};
},
runNonInteractive: async (ctx: ProviderAuthMethodNonInteractiveContext) =>
configureOpenAICompatibleSelfHostedProviderNonInteractive({
ctx,
providerId: PROVIDER_ID,
providerLabel: "SGLang",
defaultBaseUrl: DEFAULT_BASE_URL,
defaultApiKeyEnvVar: "SGLANG_API_KEY",
modelPlaceholder: "Qwen/Qwen3-8B",
}),
},
],
discovery: {

View File

@@ -1,5 +1,5 @@
{
"name": "@openclaw/sglang-provider",
"name": "@openclaw/sglang",
"version": "2026.3.11",
"private": true,
"description": "OpenClaw SGLang provider plugin",

View File

@@ -1,9 +1,11 @@
import {
buildVllmProvider,
configureOpenAICompatibleSelfHostedProviderNonInteractive,
emptyPluginConfigSchema,
promptAndConfigureOpenAICompatibleSelfHostedProvider,
type OpenClawPluginApi,
type ProviderAuthContext,
type ProviderAuthMethodNonInteractiveContext,
type ProviderAuthResult,
type ProviderDiscoveryContext,
} from "openclaw/plugin-sdk/core";
@@ -49,6 +51,15 @@ const vllmPlugin = {
defaultModel: result.modelRef,
};
},
runNonInteractive: async (ctx: ProviderAuthMethodNonInteractiveContext) =>
configureOpenAICompatibleSelfHostedProviderNonInteractive({
ctx,
providerId: PROVIDER_ID,
providerLabel: "vLLM",
defaultBaseUrl: DEFAULT_BASE_URL,
defaultApiKeyEnvVar: "VLLM_API_KEY",
modelPlaceholder: "meta-llama/Meta-Llama-3-8B-Instruct",
}),
},
],
discovery: {

View File

@@ -1,5 +1,5 @@
{
"name": "@openclaw/vllm-provider",
"name": "@openclaw/vllm",
"version": "2026.3.11",
"private": true,
"description": "OpenClaw vLLM provider plugin",