Documentation
¶
Overview ¶
Demonstrates multimodal prompt input via the opencodesdk.QueryContent one-shot helper.
This example shows three entry points:
- opencodesdk.QueryContent — one-shot text + image prompt
- opencodesdk.ImageFileInput — load an image from disk
- opencodesdk.Text / Blocks — ergonomic block constructors
The legacy string-only opencodesdk.Query still works for plain text — QueryContent is only needed when you want to attach images, embedded resources, or other non-text content blocks.
Image support requires the agent to advertise the "image" prompt capability during ACP initialize; opencode advertises it when attached to a multimodal-capable model. If the capability isn't advertised, the SDK rejects image blocks with ErrCapabilityUnavailable before the prompt reaches opencode.
go run ./examples/multimodal_input
Click to show internal directories.
Click to hide internal directories.