mirror of
http://192.168.0.88:13333/lywsvip/openclaw-zero-token.git
synced 2026-06-04 17:40:05 +08:00
Major upgrade from e26988a38 to upstream v2026.3.28 (f9b107928).
Key changes:
- Upstream src/, ui/, extensions/ (89 bundled extensions)
- Zero-token web providers preserved in src/zero-token/
- AskOnce plugin restored and registered as CLI command
- Added missing packages: @anthropic-ai/vertex-sdk, @modelcontextprotocol/sdk
- Fixed tsconfig rootDir, skipLibCheck for plugin-sdk DTS build
- Added askonce to bundled plugin metadata and package.json exports
- Fixed AskOnce CLI command registration (missing commands metadata)
- Restored AskOnce adapter imports (correct 5-level relative paths)
- Removed stale migration artifacts from root directory
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import type { ModelProviderConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
|
|
|
const OPENROUTER_BASE_URL = "https://openrouter.ai/api/v1";
|
|
const OPENROUTER_DEFAULT_MODEL_ID = "auto";
|
|
const OPENROUTER_DEFAULT_CONTEXT_WINDOW = 200000;
|
|
const OPENROUTER_DEFAULT_MAX_TOKENS = 8192;
|
|
const OPENROUTER_DEFAULT_COST = {
|
|
input: 0,
|
|
output: 0,
|
|
cacheRead: 0,
|
|
cacheWrite: 0,
|
|
};
|
|
|
|
export function buildOpenrouterProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: OPENROUTER_BASE_URL,
|
|
api: "openai-completions",
|
|
models: [
|
|
{
|
|
id: OPENROUTER_DEFAULT_MODEL_ID,
|
|
name: "OpenRouter Auto",
|
|
reasoning: false,
|
|
input: ["text", "image"],
|
|
cost: OPENROUTER_DEFAULT_COST,
|
|
contextWindow: OPENROUTER_DEFAULT_CONTEXT_WINDOW,
|
|
maxTokens: OPENROUTER_DEFAULT_MAX_TOKENS,
|
|
},
|
|
{
|
|
id: "openrouter/hunter-alpha",
|
|
name: "Hunter Alpha",
|
|
reasoning: true,
|
|
input: ["text"],
|
|
cost: OPENROUTER_DEFAULT_COST,
|
|
contextWindow: 1048576,
|
|
maxTokens: 65536,
|
|
},
|
|
{
|
|
id: "openrouter/healer-alpha",
|
|
name: "Healer Alpha",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: OPENROUTER_DEFAULT_COST,
|
|
contextWindow: 262144,
|
|
maxTokens: 65536,
|
|
},
|
|
],
|
|
};
|
|
}
|