mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-06 23:55:12 +00:00
feat: declare tencent tokenhub model catalog
This commit is contained in:
@@ -1,57 +1,19 @@
|
||||
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-catalog-shared";
|
||||
import type { ModelDefinitionConfig } from "openclaw/plugin-sdk/provider-model-shared";
|
||||
import manifest from "./openclaw.plugin.json" with { type: "json" };
|
||||
|
||||
// ---------- TokenHub provider ----------
|
||||
|
||||
export const TOKENHUB_BASE_URL = "https://tokenhub.tencentmaas.com/v1";
|
||||
export const TOKENHUB_PROVIDER_ID = "tencent-tokenhub";
|
||||
|
||||
// Hy3 preview pricing ($ per 1M tokens), tiered by input context length.
|
||||
// Flat rates mirror the first tier; tieredPricing drives actual cost calculation.
|
||||
const HY3_PREVIEW_COST = {
|
||||
input: 0.176,
|
||||
output: 0.587,
|
||||
cacheRead: 0.059,
|
||||
cacheWrite: 0,
|
||||
tieredPricing: [
|
||||
{
|
||||
input: 0.176,
|
||||
output: 0.587,
|
||||
cacheRead: 0.059,
|
||||
cacheWrite: 0,
|
||||
range: [0, 16_000] as [number, number],
|
||||
},
|
||||
{
|
||||
input: 0.235,
|
||||
output: 0.939,
|
||||
cacheRead: 0.088,
|
||||
cacheWrite: 0,
|
||||
range: [16_000, 32_000] as [number, number],
|
||||
},
|
||||
{
|
||||
input: 0.293,
|
||||
output: 1.173,
|
||||
cacheRead: 0.117,
|
||||
cacheWrite: 0,
|
||||
range: [32_000] as [number],
|
||||
},
|
||||
],
|
||||
};
|
||||
const TOKENHUB_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
||||
providerId: TOKENHUB_PROVIDER_ID,
|
||||
catalog: manifest.modelCatalog.providers[TOKENHUB_PROVIDER_ID],
|
||||
});
|
||||
|
||||
export const TOKENHUB_MODEL_CATALOG: ModelDefinitionConfig[] = [
|
||||
{
|
||||
id: "hy3-preview",
|
||||
name: "Hy3 preview (TokenHub)",
|
||||
reasoning: true,
|
||||
input: ["text"],
|
||||
contextWindow: 256_000,
|
||||
maxTokens: 64_000,
|
||||
cost: HY3_PREVIEW_COST,
|
||||
compat: {
|
||||
supportsUsageInStreaming: true,
|
||||
supportsReasoningEffort: true,
|
||||
},
|
||||
},
|
||||
];
|
||||
export const TOKENHUB_BASE_URL = TOKENHUB_MANIFEST_PROVIDER.baseUrl;
|
||||
|
||||
export const TOKENHUB_MODEL_CATALOG: ModelDefinitionConfig[] = TOKENHUB_MANIFEST_PROVIDER.models;
|
||||
|
||||
export function buildTokenHubModelDefinition(
|
||||
model: (typeof TOKENHUB_MODEL_CATALOG)[number],
|
||||
|
||||
@@ -6,6 +6,60 @@
|
||||
"enabledByDefault": true,
|
||||
"providerDiscoveryEntry": "./provider-discovery.ts",
|
||||
"providers": ["tencent-tokenhub"],
|
||||
"modelCatalog": {
|
||||
"providers": {
|
||||
"tencent-tokenhub": {
|
||||
"baseUrl": "https://tokenhub.tencentmaas.com/v1",
|
||||
"api": "openai-completions",
|
||||
"models": [
|
||||
{
|
||||
"id": "hy3-preview",
|
||||
"name": "Hy3 preview (TokenHub)",
|
||||
"reasoning": true,
|
||||
"input": ["text"],
|
||||
"contextWindow": 256000,
|
||||
"maxTokens": 64000,
|
||||
"cost": {
|
||||
"input": 0.176,
|
||||
"output": 0.587,
|
||||
"cacheRead": 0.059,
|
||||
"cacheWrite": 0,
|
||||
"tieredPricing": [
|
||||
{
|
||||
"input": 0.176,
|
||||
"output": 0.587,
|
||||
"cacheRead": 0.059,
|
||||
"cacheWrite": 0,
|
||||
"range": [0, 16000]
|
||||
},
|
||||
{
|
||||
"input": 0.235,
|
||||
"output": 0.939,
|
||||
"cacheRead": 0.088,
|
||||
"cacheWrite": 0,
|
||||
"range": [16000, 32000]
|
||||
},
|
||||
{
|
||||
"input": 0.293,
|
||||
"output": 1.173,
|
||||
"cacheRead": 0.117,
|
||||
"cacheWrite": 0,
|
||||
"range": [32000]
|
||||
}
|
||||
]
|
||||
},
|
||||
"compat": {
|
||||
"supportsUsageInStreaming": true,
|
||||
"supportsReasoningEffort": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"discovery": {
|
||||
"tencent-tokenhub": "static"
|
||||
}
|
||||
},
|
||||
"providerAuthEnvVars": {
|
||||
"tencent-tokenhub": ["TOKENHUB_API_KEY"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user