openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
18 lines (17 loc) • 1.01 kB
JavaScript
//#region src/agents/model-tool-support.ts
/**
* Model capability helper for tool-use support.
*
* Provider catalogs can opt a model out via `compat.supportsTools === false`;
* absent metadata remains permissive for older catalog entries.
*/
const MODEL_TOOLS_UNAVAILABLE_PROMPT = "## Tool availability\n\nThis model cannot use tools in this run. Do not claim that you ran commands, read or wrote files, browsed the web, generated media, or performed any other tool-backed action. If a request requires tools, say they are unavailable in this chat and ask the user to switch to a tool-capable model.";
function supportsModelTools(e) {
return (e.compat && typeof e.compat === "object" ? e.compat : void 0)?.supportsTools !== false;
}
/** Builds the bounded honesty guard for models that explicitly disable tools. */
function buildModelToolsUnavailablePrompt(e) {
return e ? void 0 : MODEL_TOOLS_UNAVAILABLE_PROMPT;
}
//#endregion
export { supportsModelTools as n, buildModelToolsUnavailablePrompt as t };