I find that the results improve when I add ", without any introduction." to the prompt.
Example:
List 10 unique unicorn names suitable for IDs with just regular ASCII characters.
{format}
->
[Here are 10 unique unicorn names that can be used as IDs with only regular ASCII characters:
Sparkle, Frosty, Onyxia, Razzle, Celestia, Starlight, Nimbus, Luminar, Aetheria, Zephyrine]
"Here are 10 unique unicorn names that can be used as IDs with only regular ASCII characters" should not an item.
When I modify it to:
List 10 unique unicorn names suitable for IDs with just regular ASCII characters,
without any introduction.
the result is correct (at least with Ollama llama3 and ChatGPT 4)
[Starlight, Sparkles, Mythic, Onyxia, Celestia, Astral, NovaSpire, Lunaria, Solaris, Mirabel]
I believe adding , without any introduction.
to the ListOutputConverter
could be beneficial.
https://github.com/spring-projects/spring-ai/blob/d7dad6ef6162a057034297222575e13401233492/spring-ai-core/src/main/java/org/springframework/ai/converter/ListOutputConverter.java#L39
Comment From: markpollack
Thanks for taking the time to report, interesting finding. will add
Comment From: markpollack
I've made a small refinement. Please let me know if there are any models for which this is failing that you encounter.
Thanks for reporting this
merged in 4b95dfc2efe4c7d85d955dd97e6446031c60f5ea