agentscope-ai / agentscope-ai/agentscope-java

[Bug]: Multimodal messages are not recognized by the model

Open
#1,782 1 comment 0 reactions 0 assignees View on GitHub
area/core/model bug
Dominant language
Java
Stars
5.6k
Forks
1.3k
Avg merge
4d 12h
Merged PRs (30d)
77

Description

## 测试代码
```java

try (HarnessAgent agent = HarnessAgent.builder()
.name("vibe-coding")
.sysPrompt(SYSTEM_PROMPT)
.model("dashscope:qwen3.6-plus")
.workspace(Path.get(".agentscope/workspace").toNioPath())
.compaction(CompactionConfig.builder()
.triggerMessages(30)
.keepMessages(10)
.build())
.build()) {
RuntimeContext context = RuntimeContext.builder()
.userId("cc")
.sessionId("cc-session-20260616")
.build();
byte[] imageBytes = Files.readAllBytes(Paths.get("D:/000.png"));

UserMessage userMessage = new UserMessage("USER", TextBlock.builder().text("描述这张图:").build(),
DataBlock.builder()
.source(Base64Source.builder().data(Base64.getEncoder().encodeToString(imageBytes))
.mediaType("image/png")
.build())
.build()
);
Msg msg = agent.call(userMessage, RuntimeContext.builder().userId("2026061602001").sessionId("2026061602").build()).block();
assert msg != null;
assert msg != null;
log.info("{}", msg.getTextContent());
} catch (Exception e) {
log.error("Agent 执行异常:{}, {}", e.getClass().getSimpleName(), e.getMessage());
}
```

## 输出
```sh

您好!我仍然没有看到您上传的图片。

请您在对话中**上传图片文件**,或者提供图片的**链接/路径**(如果图片位于工作区 `D:\Soft\Workspace\` 或 `D:\Soft...[truncated, limit=120 chars]
您好!我仍然没有看到您上传的图片。

请您在对话中**上传图片文件**,或者提供图片的**链接/路径**(如果图片位于工作区 `D:\Soft\Workspace\harness-test` 或 `D:\Soft\.agentscope\workspace` 中,请告诉我具体路径)。

一旦我看到图片,我会立即为您描述它。
```

## 版本
`2.0.0-RC3`

请问一下 是我的用法有问题吗?
谢谢!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.