spring-projects / spring-projects/spring-ai

UserMessage upload PDF cannot read

Open
#4,954 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

Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create.
If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:

Bug description
When I use an LLM model, such as ChatGPT, and upload a PDF document, the media cannot access the resources
Image

Environment
jdk21, spring-ai-1.1.0

Steps to reproduce
Media media = new Media(mediaType != null ? mediaType : MediaType.ALL, new URI(filePath));
Upload a PDF file and then send a question, such as asking what the content of the document uploaded by the large model is. It will respond that no document or image has been uploaded

Expected behavior
For the example above, I hope to retrieve the content from the document

Minimal Complete Reproducible example

Image and chatClient.prompt(prompt).stream().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 Media construction using new URI(filePath) and the chatClient.prompt(...).stream().content() reproduction; inspect how PDF media is passed to the configured LLM. Done means a PDF upload's content is available when asking a question, with a regression test for the reported jdk21/spring-ai-1.1.0 case.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.