Skip to content

SystemPromptTemplate removes double curly braces {{...}} when rendering prompts #3721

Closed
@SaurabhDesaiCeloxis

Description

@SaurabhDesaiCeloxis

Description

When using SystemPromptTemplate in Spring AI, any usage of double curly braces like {{ this is my line }} gets removed entirely in the final output, instead of escaping to { this is my line } or remaining as-is.

Sample code

String template = "{{ this is my line }}";
SystemPromptTemplate promptTemplate = new SystemPromptTemplate(template);
String result = promptTemplate.create(Map.of()).getContents();
System.out.println(result);

Expected Output

{ this is my line }

Actual Output

this is my line

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions