Jinja2 works natively together with the BDK for Python rather than requiring a BDK-specific dependency like for Freemarker or Handlebars in BDK for Java. If you are using the Symphony Generator to create a new BDK for Python project, it already ships with an example that demonstrates how to integrate Jinja2 templates with the Activities API.
Here's a simple example of how to use Jinja2 in a bot that just sends a templated message and terminates:
from jinja2 import Template
async def run():
config = BdkConfigLoader.load_from_file(Path.joinpath(current_dir, 'resources', 'config.yaml'))
async with SymphonyBdk(config) as bdk:
template = Template(open('resources/my_template.jinja2').read(), autoescape=True)
message = template.render(some_key='some_value')
await bdk.messages().send_message(stream_id, message)