conductor-oss/conductor · error · UnsupportedOperationException
Image generation not supported by the model yet
Error message
Image generation not supported by the model yet
What it means
Bedrock.getImageModel() throws unconditionally because the Bedrock provider implementation does not wire up an image generation model. While AWS Bedrock does host image-generation models (Stability AI, Amazon Titan Image Generator), this Conductor provider only implements chat (via BedrockProxyChatModel) and embeddings (via Cohere). The interface contract is fulfilled by throwing UnsupportedOperationException.
Source
Thrown at ai/src/main/java/org/conductoross/conductor/ai/providers/bedrock/Bedrock.java:148
String model = input.getModel();
log.info("\n\nusing bedrock model: {}", model);
return BedrockChatOptions.builder()
.model(model)
.maxTokens(input.getMaxTokens())
.topP(input.getTopP())
.temperature(input.getTemperature())
.toolCallbacks(getToolCallback(input))
.stopSequences(input.getStopWords())
.frequencyPenalty(input.getFrequencyPenalty())
.topK(input.getTopK())
.internalToolExecutionEnabled(false)
.presencePenalty(input.getPresencePenalty())
.build();
}
@Override
public ImageModel getImageModel() {
throw new UnsupportedOperationException("Image generation not supported by the model yet");
}
private Map<String, Object> getEmbeddingRequest(String modelId, String text) {
return Map.of(
"input_type", "search_document",
"embedding_types", List.of("float"),
"texts", List.of(text));
}
@SneakyThrows
private List<Float> extractEmbeddings(String modelId, InvokeModelResponse response) {
if (!modelId.startsWith("cohere.")) {
throw new RuntimeException("Unsupported model " + modelId);
}
byte[] byteArray = response.body().asByteArray();
Map<String, Map<String, Object>> ressMap = om.readValue(byteArray, Map.class);
List<List<Float>> floats = (List<List<Float>>) ressMap.get("embeddings").get("float");
return floats.get(0);View on GitHub (pinned to cf7c3e4a8a)
Solutions
- Route image generation to a provider with an implemented ImageModel: 'openai', 'azure_openai', 'vertex_ai'/'google_gemini', or 'stabilityai'.
- If you need Bedrock image models specifically, implement getImageModel() in the Bedrock provider using an InvokeModel call to stability.stable-image-* or amazon.titan-image-*.
- Check provider capabilities before dispatching.
Example fix
// before String provider = "bedrock"; AIModel model = providerRegistry.get(provider); ImageModel img = model.getImageModel(); // throws // after String provider = "openai"; AIModel model = providerRegistry.get(provider); ImageModel img = model.getImageModel();
Defensive patterns
Strategy: validation
Validate before calling
// Validate Bedrock supports image generation before calling
private static final Set<String> IMAGE_CAPABLE_PROVIDERS =
Set.of("openai", "azure_openai", "vertex_ai", "google_gemini", "stabilityai");
void validateImageCapability(String providerName) {
if (!IMAGE_CAPABLE_PROVIDERS.contains(providerName)) {
throw new IllegalArgumentException(
"Provider '" + providerName + "' does not support image generation");
}
} Type guard
static boolean supportsImageGeneration(AIModel model) {
try {
model.getImageModel();
return true;
} catch (UnsupportedOperationException e) {
return false;
}
} Try / catch
try {
ImageModel img = bedrock.getImageModel();
} catch (UnsupportedOperationException e) {
throw new IllegalArgumentException(
"Bedrock does not implement image generation in this provider. "
+ "Use openai, vertex_ai, or stabilityai.", e);
} Prevention
- Maintain a capability matrix for providers — image generation is only available on openai, azure_openai, vertex_ai/google_gemini, and stabilityai.
- Validate provider-capability compatibility at task registration time.
- If you need Bedrock image models (Stability/Titan), implement getImageModel() in the Bedrock provider with an InvokeModel call.
When it happens
Trigger: Calling getImageModel() on a Bedrock provider instance — e.g. a GenerateImage task routed to provider 'bedrock'.
Common situations: Routing an image generation task to Bedrock expecting it to use Stability/Titan image models. A generic dispatcher that assumes all providers support image generation.
Related errors
- Image generation not supported by the model yet
- Image generation not supported by Cohere
- Not supported
- Image generation not supported by the model yet
- Image generation not supported by the model yet
AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14).
Data as JSON: /api/errors/bc787facc0caa388.
Report an issue: GitHub.