admin管理员组文章数量:1312932
I am trying to include jinja2 templates within my uv build but it does not seem to work. My directory structure is as follows.
project/
├── src/
│ ├── mypackage/
│ └──── j2/ (all templates live here)
└── pyproject.toml
Following is my py project toml
[project]
name = "dojipipeline"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"groq>=0.16.0",
"jinja2>=3.1.5",
"pydantic>=2.10.6",
"python-dotenv>=1.0.1",
"pyyaml>=6.0.2",
]
My work around is to capture all the j2 as doc_string in .py file like below and import it
#j2_template.py
GENERATE_DATA_MODEL = """
You are a data governance expert and are tasked to perform the following
{ % for task in tasks % }
{{ task }}
{ % endfor % }
===========================
{% if contexts %}
Following are the contexts for the tasks:
{% for context in contexts %}
{{ context }}
{% endfor %}
{% endif %}
The required responses must be in JSON format.
"response": {
"data": {{ data_shema }}
"thoughts": List of thoughts
}
Generate a valid data object and explain your thought process.
Answer only with json and do not include any other information.
"""
本文标签: pythonBundling Jinja2 temlate with UVStack Overflow
版权声明:本文标题:python - Bundling Jinja2 temlate with UV - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741885709a2403010.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论