mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
a57e8c70f5
* feat(meta): add Muse Spark 1.2 models * fix(meta): verify Muse Spark 1.2 catalog metadata * fix(meta): verify Muse Spark 1.2 contracts * docs(meta): quote discounted services terms * fix(meta): preserve replay fields for simple completions * test(meta): align stream host adapter types * fix(meta): apply catalog cap for zero max tokens * fix(meta): preserve omitted output cap * fix(meta): scope responses stream wrapper * fix(ai): preserve source API for stream wrappers * fix(ai): distinguish hook and dispatch APIs * test(ai): adapt plugin streams synchronously * chore(plugin-sdk): refresh API baseline * chore(plugin-sdk): refresh sharded API baseline --------- Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
// Meta plugin module implements thinking behavior.
|
|
import type {
|
|
ProviderDefaultThinkingPolicyContext,
|
|
ProviderThinkingProfile,
|
|
} from "openclaw/plugin-sdk/plugin-entry";
|
|
import { META_MODEL_CATALOG } from "./models.js";
|
|
|
|
const META_REASONING_MODEL_IDS = new Set(
|
|
META_MODEL_CATALOG.filter((model) => model.reasoning).map((model) => model.id.toLowerCase()),
|
|
);
|
|
|
|
const META_THINKING_LEVEL_IDS = ["off", "minimal", "low", "medium", "high", "xhigh"] as const;
|
|
|
|
const META_THINKING_PROFILE = {
|
|
levels: META_THINKING_LEVEL_IDS.map((id) => ({ id })),
|
|
defaultLevel: "high",
|
|
} satisfies ProviderThinkingProfile;
|
|
|
|
export function resolveMetaThinkingProfile(
|
|
context: ProviderDefaultThinkingPolicyContext,
|
|
): ProviderThinkingProfile | undefined {
|
|
// Some control-plane callers have no runtime catalog. Fall back to the
|
|
// process-stable manifest so those paths retain the same model policy.
|
|
const reasoning =
|
|
context.reasoning ?? META_REASONING_MODEL_IDS.has(context.modelId.toLowerCase());
|
|
return reasoning ? META_THINKING_PROFILE : undefined;
|
|
}
|