Closed viewhang closed 4 months ago
success like this,but @Deprecated(since = "1.0.0 M1", forRemoval = true)
String chatWithImage(String message, File imageFile) throws IOException {
final String base64Str = Base64.getEncoder().encodeToString(Files.readAllBytes(Paths.get(imageFile.getPath())));
final Media recourceMedia = new Media(MimeTypeUtils.IMAGE_PNG, base64Str);
String content = chatClient.prompt()
.user(userSpec -> userSpec
.text(message)
.media(recourceMedia)
)
.call()
.content();
logger.info(content);
return content;
}
hi, I haven't added multi-modal (GLM-4V) support yet. i will take a look at this issue later.
i have add multi-model support in PR #859
@viewhang hi, i noticed the PR has been merged, you can pull the code and give it try 😊
it works well Thanks
Bug description zhipu multiple modal api doc
The
image_url. url
here can be a base64 string but should not include the prefix like thisdata:image/png;base64,
Environment Spring AI version:
Java version:17
Steps to reproduce
return
Expected behavior request success
Minimal Complete Reproducible example see Steps to reproduce