Skip to contents

Returns a SHA-256 hash over a tool's name, description, and parameter schema (its implementation function is deliberately excluded, so the signature tracks the contract a model sees, not the R code). Use it to detect when a tool's advertised interface has changed, for example to pin a tool schema and notice a silent redefinition.

Usage

llm_tool_signature(tool)

Arguments

tool

An llmr_tool (from llm_tool()), or a list carrying name, description, and schema.

Value

A 64-character lowercase hex string.

See also

Examples

tl <- llm_tool(function(x) x, "echo", "Echo a value",
               parameters = list(x = list(type = "string")))
llm_tool_signature(tl)