Closed EricLBuehler closed 7 months ago
It's quite intentional that methods of Python objects are not exposed. For the same reason |items
is used rather than .items()
and a filter has been added to Jinja2 to match the two engines. For .strip()
there is a |trim
filter which has the same behavior.
{{ " foo "|trim }}
Closing this as out of scope.
Thank you!
On further reconsideration I do think it might be useful to add a callback to the environment so that someone could on their own fill in the blanks if they have a need.
I added a hook now in #441 which should help if you want to make this work.
Thank you, I saw that and will look into using it!
Hello all,
I am using
minijinja
to implement chat templating for LLMs. However, some templates call the.strip()
method and I cannot find a way to inject this object. Is this possible to do? Thank you!