mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 00:11:19 +00:00
Summary: - Merged feat(tencent): add Tencent Hy3 provider (TokenHub and TokenPlan) after ClawSweeper review. Automerge notes: - Ran the ClawSweeper repair loop before final review. - Included post-review commit in the final squash: fix(tencent): preserve TokenHub auth compatibility - Included post-review commit in the final squash: refactor(tencent): unify TokenPlan env/flag naming with TokenHub - Included post-review commit in the final squash: docs: refresh Tencent provider docs metadata - Included post-review commit in the final squash: fix: allow TokenPlan provider config overlays - Included post-review commit in the final squash: docs: dedupe Tencent provider glossary labels - Included post-review commit in the final squash: fix(tencent): repair TokenHub model defaults Validation: - ClawSweeper review passed for head 30c9fc130f26a038d1430c14e710eb77d99fb0d4. - Required merge gates passed before the squash merge. Prepared head SHA: 30c9fc130f26a038d1430c14e710eb77d99fb0d4 Review: https://github.com/openclaw/openclaw/pull/99076#issuecomment-4888527271 Co-authored-by: leisang <leisang@tencent.com> Co-authored-by: Mason Huang <masonxhuang@tencent.com> Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: hxy91819
48 lines
1.5 KiB
TypeScript
48 lines
1.5 KiB
TypeScript
// Tencent plugin module implements models behavior.
|
|
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_PROVIDER_ID = "tencent-tokenhub";
|
|
|
|
const TOKENHUB_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
providerId: TOKENHUB_PROVIDER_ID,
|
|
catalog: manifest.modelCatalog.providers[TOKENHUB_PROVIDER_ID],
|
|
});
|
|
|
|
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],
|
|
): ModelDefinitionConfig {
|
|
return {
|
|
...model,
|
|
api: "openai-completions",
|
|
};
|
|
}
|
|
|
|
// ---------- TokenPlan provider ----------
|
|
|
|
export const TOKENPLAN_PROVIDER_ID = "tencent-tokenplan";
|
|
|
|
const TOKENPLAN_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
providerId: TOKENPLAN_PROVIDER_ID,
|
|
catalog: manifest.modelCatalog.providers[TOKENPLAN_PROVIDER_ID],
|
|
});
|
|
|
|
export const TOKENPLAN_BASE_URL = TOKENPLAN_MANIFEST_PROVIDER.baseUrl;
|
|
|
|
export const TOKENPLAN_MODEL_CATALOG: ModelDefinitionConfig[] = TOKENPLAN_MANIFEST_PROVIDER.models;
|
|
|
|
export function buildTokenPlanModelDefinition(
|
|
model: (typeof TOKENPLAN_MODEL_CATALOG)[number],
|
|
): ModelDefinitionConfig {
|
|
return {
|
|
...model,
|
|
api: "openai-completions",
|
|
};
|
|
}
|