spring-ai
spring-ai copied to clipboard
Include something similar to “without any introduction” in ListOutputConverter
trafficstars
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