Skip to content

fix: disable HTML escaping of prompt compile inputs#543

Merged
hassiebp merged 9 commits into
mainfrom
lf-718-remove-escaping-from-compiled-prompts
Apr 9, 2024
Merged

fix: disable HTML escaping of prompt compile inputs#543
hassiebp merged 9 commits into
mainfrom
lf-718-remove-escaping-from-compiled-prompts

Conversation

@hassiebp
Copy link
Copy Markdown
Contributor

@hassiebp hassiebp commented Apr 8, 2024

Disable HTML escaping of prompt compile inputs

Changes

  • Removes chevron as template-replacement library as it does not support disabling HTML escaping
  • Introduced custom compile_template_string function with test suite
  • Jinja2 has the following restrictions on variable names. If the prompt feature users decide to keep a variable unused and see it rendered within double curly braces, Jinja2 would throw an error as it cannot parse the variable name.

@hassiebp hassiebp requested review from a team and maxdeichmann April 8, 2024 15:12
@hassiebp hassiebp marked this pull request as draft April 9, 2024 09:47
@hassiebp hassiebp marked this pull request as ready for review April 9, 2024 12:51
Comment thread langfuse/model.py
Comment thread langfuse/utils/compile_template_string.py Outdated
@hassiebp hassiebp enabled auto-merge (squash) April 9, 2024 14:28
@hassiebp hassiebp merged commit 89f2384 into main Apr 9, 2024
@hassiebp hassiebp deleted the lf-718-remove-escaping-from-compiled-prompts branch April 9, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants