summaryrefslogtreecommitdiff
path: root/examples/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'examples/extensions')
-rw-r--r--examples/extensions/echo.lua22
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,
+}