From 07a04d08a9ff1f473b7ba74e3fc9636cc5f0d1d8 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Thu, 31 Jul 2025 01:51:28 -0400 Subject: [PATCH] Add `WithDescription` method to `Function` struct Extend the `Function` struct with a `WithDescription` method to allow setting descriptions fluently. --- function.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/function.go b/function.go index 9bdd17a..db27b96 100644 --- a/function.go +++ b/function.go @@ -47,6 +47,11 @@ func (f Function) WithSyntheticFields(fieldsAndDescriptions map[string]string) F return f } +func (f Function) WithDescription(description string) Function { + f.Description = description + return f +} + func (f Function) Execute(ctx *Context, input string) (any, error) { if !f.fn.IsValid() { return "", fmt.Errorf("function %s is not implemented", f.Name)