Chat template: Don't use dict for context

#38
by stadlerb - opened

The statement {% set _ = context.update({'has_head': false}) %} causes the exception jinja2.exceptions.SecurityError: access to attribute 'update' of 'dict' object is unsafe.when sandboxing is enabled. If I understand correctly, a dictionary should not be necessary because context only has a single, fixed key 'has_head' and is not passed as such but only context.has_headis used in if conditions.

Ready to merge
This branch is ready to get merged automatically.

Sign up or log in to comment