Closed eschnou closed 2 weeks ago
I have a fix for this and will open a PR shortly.
@thesurlydev do you have any opinions on this issue - https://github.com/spring-projects/spring-ai/issues/355 ?
@markpollack I read through the comments and I see advantages to both the default delimeters and the current adoption of curly braces. Normally, I'd just go with the ST default but I do like the curly braces because they align better with other Python frameworks in terms of prompt placeholders.
Ultimately, my preference would be to continue using curly braces as the default delimiters but also provide the option to override via configuration.
Bug description Attempting to iterate on a list of item in a PromptTemplate leads to the following error. This is due to the validation being too restrictive and interpreting the token used for iterating on the array as a required input.
java.lang.IllegalStateException: All template variables were not replaced. Missing variable names are [item]
Environment Spring AI 0.8.1
Steps to reproduce
The following unit test fails:
Expected behavior
The same pattern used directly within a template does work. I would expect the same to be used within a PromptTemplate.