griptape icon indicating copy to clipboard operation
griptape copied to clipboard

Allow passing k/v pairs to a custom J2 template

Open vachillo opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I have custom J2 templates that i would like to use, but i have no way to pass custom k/v pairs without overriding the entire class

Describe the solution you'd like I want to pass a dict to a Tool/Engine that use J2 templates that i can use to pass in k/v pairs to render to my custom template

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

vachillo avatar Jun 17 '24 15:06 vachillo

This should be implemented through the following:

  1. Add task: self to BaseTask.full_context.
  2. Add context: self.full_context as arguments to all Task uses of J2.render.

collindutter avatar Jun 18 '24 15:06 collindutter

@vachillo I know this is quite old but can you expand on the ask here? Can you provide a code snippet that shows what you're trying to do?

collindutter avatar Jan 07 '25 21:01 collindutter