Skip to content

Outdated/Deprecated Example in OpenAI Multimodal Documentation #1012

@AshwinKrishnaK

Description

@AshwinKrishnaK

The current documentation for the OpenAI Multimodal example is outdated and uses deprecated methods in the latest version. Specifically, the example provided is as follows:

byte[] imageData = new ClassPathResource("/multimodal.test.png").getContentAsByteArray();

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

ChatResponse response = chatModel.call(new Prompt(List.of(userMessage),
        OpenAiChatOptions.builder().withModel(OpenAiApi.ChatModel.GPT_4_VISION_PREVIEW.getValue()).build()));
var userMessage = new UserMessage("Explain what do you see on this picture?",
        List.of(new Media(MimeTypeUtils.IMAGE_PNG,
                "https://docs.spring.io/spring-ai/reference/1.0-SNAPSHOT/_images/multimodal.test.png")));

ChatResponse response = chatModel.call(new Prompt(List.of(userMessage),
        OpenAiChatOptions.builder().withModel(OpenAiApi.ChatModel.GPT_4_O.getValue()).build()));

Issues:

  1. The method of passing imageData as byte[] is deprecated.
  2. The chatModel.call method used in the example is also deprecated.

This outdated example may cause confusion and errors for users trying to implement multimodal functionalities using the latest version of the OpenAI API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions