-
Notifications
You must be signed in to change notification settings - Fork 2k
Open
Description
Bug description
I'm trying to send a list of images to ChatGPT to analyze, but it's insisting that no images are sent.
I enabled request logging and found that the image list is ignored.
Environment
Spring AI 1.0.2
Java 17
Minimal Complete Reproducible example
try(InputStream inputStream = Files.newInputStream(Path.of("1.jpg"));
InputStream inputStream2 = Files.newInputStream(Path.of("2.jpg"));
InputStream inputStream3 = Files.newInputStream(Path.of("3.jpg")))
{
System.out.println(this.chatClient.prompt()
.system("Check <something relevant to all the images>")
.user(userSpec -> userSpec
.media(MimeTypeUtils.IMAGE_JPEG, new InputStreamResource(inputStream))
.media(MimeTypeUtils.IMAGE_JPEG, new InputStreamResource(inputStream2))
.media(MimeTypeUtils.IMAGE_JPEG, new InputStreamResource(inputStream3)))
.call()
.content());
}