spring-projects / spring-projects/spring-ai

Documentation: The example code for Vision in the OpenAI reference documentation is incorrect.

Open
#3,486 3 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 7h
Merged PRs (30d)
6

Description

Bug description
Image
https://docs.spring.io/spring-ai/reference/api/chat/openai-chat.html#_vision
In the 1.0.0 version of the documentation, the Vision example shown is actually from version 1.1.0-SNAPSHOT. Shouldn't the example below be included instead if it's truly the 1.0.0 documentation?

var imageData = new ClassPathResource("/test.png");

var userMessage = UserMessage.builder()
	.text("Explain what do you see on this picture?")
	.media(List.of(new Media(MimeTypeUtils.IMAGE_PNG, imageData)))		
	.build();

var response = this.chatModel
	.call(new Prompt(List.of(userMessage), OpenAiChatOptions.builder().model(modelName).build()));

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

Open the Vision section at docs.spring.io/spring-ai/reference/api/chat/openai-chat.html#_vision and compare the example shown for version 1.0.0 with the version-specific source. Update the 1.0.0 documentation so its example matches that release, then verify the rendered example and version link.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.