Skip to content

fix(multimodal): fix UnsupportedOperationException for BigDecimal/BigInteger in message content - #255

Merged
lzsweb merged 1 commit into
mainfrom
dev/issues-6
Aug 7, 2026
Merged

fix(multimodal): fix UnsupportedOperationException for BigDecimal/BigInteger in message content#255
lzsweb merged 1 commit into
mainfrom
dev/issues-6

Conversation

@lzsweb

@lzsweb lzsweb commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • Added TestMultiModalMessageAdapter (3 cases): BigDecimal/BigInteger and fallback object through the toJsonTree path, plus the streaming-writer path
  • All 3 tests pass on the fix; 2 fail on the pre-fix code (reproduces the issue)

…Integer in message content (#250)

JsonTreeWriter.jsonValue() throws UnsupportedOperationException, but
MultiModalConversationParam.getInput() serializes messages via
Gson.toJsonTree(), so a BigDecimal/BigInteger value (e.g. fps) in message
content crashed the request before sending. Regression introduced by #244
in v2.22.25. Write numbers with value(Number) and serialize fallback
objects directly into the writer instead.
@lzsweb
lzsweb merged commit 7be4b73 into main Aug 7, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

多模态请求发送前抛异常 com.alibaba.dashscope.exception.ApiException

1 participant