diff --git a/pyproject.toml b/pyproject.toml index edbcd7c..c178876 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "funcchain" -version = "0.3.2" +version = "0.3.3" description = "🔖 write prompts as python functions" authors = [{ name = "Shroominic", email = "contact@shroominic.com" }] dependencies = [ diff --git a/src/funcchain/backend/prompt.py b/src/funcchain/backend/prompt.py index 4cb2131..fbf624e 100644 --- a/src/funcchain/backend/prompt.py +++ b/src/funcchain/backend/prompt.py @@ -23,6 +23,9 @@ def create_instruction_prompt( ) -> "HumanImageMessagePromptTemplate": template_format = _determine_format(instruction) + if template_format == "jinja2" and "\n{format_instructions}" in instruction: + instruction = instruction.replace("\n{format_instructions}", "\n{{ format_instructions }}") + required_f_str_vars = _extract_template_vars(instruction, template_format) _filter_fstring_vars(input_kwargs)