I guess you need to use double curly paranthesis in your prompt to avoid string manipulation errors. I know the error message doesn't seem to be related to that.
Instead of {a: b} -> {{a: b}}