mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-10 00:11:19 +00:00
14 lines
535 B
TypeScript
14 lines
535 B
TypeScript
/**
|
|
* 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.
|
|
*/
|
|
/** Returns whether a catalog model should be offered tool calls. */
|
|
export function supportsModelTools(model: { compat?: unknown }): boolean {
|
|
const compat =
|
|
model.compat && typeof model.compat === "object"
|
|
? (model.compat as { supportsTools?: boolean })
|
|
: undefined;
|
|
return compat?.supportsTools !== false;
|
|
}
|