diff options
| author | T <t@tjp.lol> | 2026-05-26 11:10:15 -0600 |
|---|---|---|
| committer | T <t@tjp.lol> | 2026-05-26 11:14:57 -0600 |
| commit | e65ea596306721d3a2327cf6230e7106db77a414 (patch) | |
| tree | 18f7848fc737dc743993b6ca1ff2e5a954327307 /examples/extensions/echo.lua | |
| parent | edad4fc123099a780d960feea4fe37efb6d979d8 (diff) | |
basic lua tools
Diffstat (limited to 'examples/extensions/echo.lua')
| -rw-r--r-- | examples/extensions/echo.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/extensions/echo.lua b/examples/extensions/echo.lua new file mode 100644 index 0000000..d13920e --- /dev/null +++ b/examples/extensions/echo.lua @@ -0,0 +1,22 @@ +-- A trivial Lua tool that echoes back whatever the LLM asks it to. +-- Useful for exercising the panto CLI's Lua extension path end-to-end. +-- +-- Load with: panto --lua examples/extensions/echo.lua + +panto.register_tool { + name = "echo", + description = "Echo back the given message. Useful for testing whether tools work.", + schema = { + type = "object", + properties = { + message = { + type = "string", + description = "The text to echo back.", + }, + }, + required = { "message" }, + }, + handler = function(input) + return "echo: " .. input.message + end, +} |
