Skip to content

Commit

Permalink
⬆️ v0.3.3 - fix jinja format instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Apr 20, 2024
1 parent 062a182 commit 7c860c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" }]
dependencies = [
Expand Down
3 changes: 3 additions & 0 deletions src/funcchain/backend/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7c860c9

Please sign in to comment.