To make the model respond in double-curly braces is a typical prompt to filter for the concrete output, allowing the model some monologue or chain of thought beforehand.
With Langchain, it’s a minor inconvenience (and somewhat unclear how to circumvent the issue) that placeholder variables (similar to f-strings) are within single braces in a Langchain PromptTemplate.
To escape a single pair of curly braces, you need to double them.
As long as you don’t keep them odd-numbered, you should be fine.
```python
{{Some text}} -> {Some text}
{{{{Some text}}}} -> {{Some text}}
```
**Update:**
In a completely unrelated task, I have encountered a similar issue. The solution above is actually the canonical Python way of handling brackets in f-strings.
[https://stackoverflow.com/a/42521252](https://stackoverflow.com/a/42521252)