Files
openclaw/extensions/baseten/thinking.ts
Peter Steinberger 2bd1a63075 feat: add Baseten Model API provider (#108708)
* feat: add Baseten model provider

* test: satisfy Baseten provider lint

* fix: align Baseten thinking controls

* docs: refresh Baseten documentation metadata

* fix: preserve Baseten DeepSeek replay metadata

* docs: remove release-owned Baseten changelog entry
2026-07-16 07:41:33 -07:00

25 lines
970 B
TypeScript

/** Baseten model-specific thinking controls. */
import type { ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry";
import { usesBasetenChatTemplateThinking } from "./models.js";
const BASETEN_BINARY_THINKING_PROFILE = {
levels: [{ id: "off" }, { id: "low", label: "on" }],
defaultLevel: "off",
} as const satisfies ProviderThinkingProfile;
const BASETEN_GLM_52_THINKING_PROFILE = {
levels: [{ id: "off" }, { id: "high" }, { id: "max" }],
defaultLevel: "off",
} as const satisfies ProviderThinkingProfile;
/** Exposes only the thinking levels that Baseten actually accepts for opt-in models. */
export function resolveBasetenThinkingProfile(
modelId: string,
): ProviderThinkingProfile | undefined {
const normalized = modelId.trim().toLowerCase();
if (normalized === "zai-org/glm-5.2") {
return BASETEN_GLM_52_THINKING_PROFILE;
}
return usesBasetenChatTemplateThinking(normalized) ? BASETEN_BINARY_THINKING_PROFILE : undefined;
}