Open gureckis opened 1 year ago
This is good point. I see you sent in a PR to expose Id. You could also use Mock for this.
However I think ideally you wouldn't have to change the decorator during debugging. I'll try to think of a better to expose the templates in an intuitive way to get around the lazy calls.
Hi great looking library. Love the simplicity!
I'm playing with things and exploring the examples but I'm sort of curious how I could print out my rendered template prior to running it. For example from this basic example:
I see that a call to
math_prompt('what is 1+1?').run()
will execute but was thinking with the lazy loading that something likemath_prompt("what is 1+1?").render()
would print out the rendered jinja template. I see how could just use jinja for that but in the flow of debugging it seems a useful utility function. Happy to make a PR if you give me a hint or let me know how you would think about this.<inor update... part of the reason is that the function might itself provide new inputs to the template using hard to predict computations. As a simple example, I look up the date today and add it to the template:
where
test.pmpt.tpl
isThe snippet above worked to print out the final template during the run but maybe could be done prompt or chain itself.