mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-02 00:42:49 +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]>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import {
|
|
applyProviderConfigWithDefaultModelsPreset,
|
|
type HanzoBotConfig,
|
|
} from "openclaw/plugin-sdk/provider-onboard";
|
|
import { XAI_BASE_URL, XAI_DEFAULT_MODEL_ID } from "./model-definitions.js";
|
|
import { buildXaiCatalogModels } from "./model-definitions.js";
|
|
|
|
export const XAI_DEFAULT_MODEL_REF = `xai/${XAI_DEFAULT_MODEL_ID}`;
|
|
|
|
function applyXaiProviderConfigWithApi(
|
|
cfg: HanzoBotConfig,
|
|
api: "openai-completions" | "openai-responses",
|
|
primaryModelRef?: string,
|
|
): HanzoBotConfig {
|
|
return applyProviderConfigWithDefaultModelsPreset(cfg, {
|
|
providerId: "xai",
|
|
api,
|
|
baseUrl: XAI_BASE_URL,
|
|
defaultModels: buildXaiCatalogModels(),
|
|
defaultModelId: XAI_DEFAULT_MODEL_ID,
|
|
aliases: [{ modelRef: XAI_DEFAULT_MODEL_REF, alias: "Grok" }],
|
|
primaryModelRef,
|
|
});
|
|
}
|
|
|
|
export function applyXaiProviderConfig(cfg: HanzoBotConfig): HanzoBotConfig {
|
|
return applyXaiProviderConfigWithApi(cfg, "openai-completions");
|
|
}
|
|
|
|
export function applyXaiResponsesApiConfig(cfg: HanzoBotConfig): HanzoBotConfig {
|
|
return applyXaiProviderConfigWithApi(cfg, "openai-responses");
|
|
}
|
|
|
|
export function applyXaiConfig(cfg: HanzoBotConfig): HanzoBotConfig {
|
|
return applyXaiProviderConfigWithApi(cfg, "openai-completions", XAI_DEFAULT_MODEL_REF);
|
|
}
|