Prompts
Filter Functions
Transform values in your prompts using filter functions
AgentMark provides a set of built-in filters that you can use to manipulate and transform data within your prompts. Filters are functions that take an input value and return a transformed output.
Basic Usage
Use filters by calling them on values in your prompts:
Built-in Filters
AgentMark includes several built-in filters:
Text Manipulation
capitalize(str)
: Capitalizes first character of stringlower(str)
: Converts string to lowercaseupper(str)
: Converts string to uppercasetruncate(str, length)
: Truncates string to specified lengthreplace(str, search, replace)
: Replaces text in string
Array Operations
join(array, separator)
: Joins array elements with separator
Number Formatting
abs(num)
: Returns absolute valueround(num, decimals)
: Rounds number to decimal places
Data Transformation
dump(obj)
: Converts object to JSON stringurlencode(str)
: URL encodes a string
Creating Custom Filters
You can create and register custom filters:
Then use in your prompts:
Best Practices
- Use descriptive filter names
- Handle invalid input types gracefully
- Keep filters focused on single transformations
Have Questions?
We’re here to help! Choose the best way to reach us:
Join our Discord community for quick answers and discussions
Email us at hello@puzzlet.ai for support
Schedule an Enterprise Demo to learn about our business solutions
Was this page helpful?