spring-projects / spring-projects/spring-ai

My image list is not sent in the request

Open
#4,480 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
1d 10h
Merged PRs (30d)
5

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());
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the minimal Java reproduction and request logging described in the issue, checking how the three calls to media are represented in the outgoing ChatGPT request. Done means all three JPEG images appear in the request and the model can analyze them together.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
ai, api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.