中转 api 经过测试可以正常画图,并且返回的内容是 base64 图片 :
{
"role": "assistant",
"content": "",
"createAt": 1770184552571,
"id": "5",
"reasoningContent": "**Outlining the Infographic**\n\nI've outlined the infographic's content, focusing on the embedding model and RAG system.xxxx.\n\n\n",
"isReasoningExpanded": false,
"isThinkingComplete": true,
"hasAutoCollapsed": true,
"status": "complete"
}
我配置在 openclaw 中:
"xyz": {
"baseUrl": "https://api.example.com",
"apiKey": "sk-xxx",
"api": "google-generative-ai",
"models": [
{
"id": "gemini-3-pro-image-preview",
"name": "gemini-image",
"reasoning": false,
"input": [
"text"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 200000,
"maxTokens": 64000
}
]
}
}
并且配置了这个 agent:
{
"id": "image-agent",
"name": "image creator",
"workspace": "/root/.openclaw/workspaces/image-agent",
"model": {
"primary": "xyz/gemini-3-pro-image-preview"
}
}
但是我在 tg 让其作图时候报错: Incomplete JSON segment at the end
应该是无法解析 base64 的 content 。
让主 agent 解决,它也没太有办法:
有两个选择:
1. 临时方案:给画师 agent 写个 system prompt
让它用工具把 base64 保存成文件,然后用 message 工具发送图片。但这比较 hacky 。
2. 正确方案:向 OpenClaw 提 issue/PR
让 OpenClaw 支持解析模型响应中的 markdown base64 图片,自动提取并作为附件发送。
但我看很多人配置作图都是正常的,应该是直接支持的。