{"record":{"id":"34d250e79f40a0dd","repo":"conductor-oss/conductor","slug":"image-generation-not-supported-by-the-model-yet","errorCode":null,"errorMessage":"Image generation not supported by the model yet","messagePattern":"Image generation not supported by the model yet","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/anthropic/Anthropic.java","lineNumber":119,"sourceCode":"        }\n\n        return AnthropicChatOptions.builder()\n                .model(input.getModel())\n                .maxTokens(maxTokens)\n                .temperature(temperature)\n                .topP(input.getTopP())\n                .topK(input.getTopK())\n                .stopSequences(input.getStopWords())\n                .thinkingBudgetTokens(thinkingBudget)\n                .reasoningEffort(input.getReasoningEffort())\n                .reasoningSummary(input.getReasoningSummary())\n                .tools(tools.isEmpty() ? null : tools)\n                .build();\n    }\n\n    @Override\n    public ImageModel getImageModel() {\n        throw new UnsupportedOperationException(\"Image generation not supported by the model yet\");\n    }\n\n    // -- Helpers --\n\n    @SuppressWarnings(\"unchecked\")\n    private List<Tool> convertTools(ChatCompletion input) {\n        List<Tool> tools = new ArrayList<>();\n\n        // Built-in tools\n        if (input.isWebSearch()) {\n            tools.add(Tool.webSearch());\n        }\n        if (input.isCodeInterpreter()) {\n            tools.add(Tool.codeExecution());\n        }\n\n        // Convert Conductor ToolSpecs to Anthropic function tools\n        if (input.getTools() != null) {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/anthropic/Anthropic.java#L101-L137","documentation":"Thrown unconditionally by Anthropic.getImageModel() because Anthropic Claude models are text/multimodal chat models with no native image-generation capability. The AIModel interface requires every provider to implement getImageModel(), and Anthropic fulfills the contract by throwing UnsupportedOperationException rather than returning a non-functional model. The 'yet' in the message is aspirational — the capability is not on any current Claude roadmap.","triggerScenarios":"Any code path that calls aiModel.getImageModel() on a provider resolved to the 'anthropic' name. This includes a Conductor GenerateImage task whose provider field is set to 'anthropic', or a generic capability-dispatch router that iterates providers and calls getImageModel() without checking which provider it holds.","commonSituations":"Misconfiguring an image-generation workflow/task to target the Anthropic provider. A generic task mapper that assumes all providers support all capability types. Copying a task definition from a working OpenAI image task and only changing the model name to a Claude model.","solutions":["Route the image generation request to a provider that supports it: 'openai', 'azure_openai', 'vertex_ai'/'google_gemini', or 'stabilityai'.","Add a capability check before calling getImageModel() — verify the provider name is in the set of image-capable providers.","If building a generic dispatcher, catch UnsupportedOperationException and present a user-facing error indicating the provider lacks image support."],"exampleFix":"// before\nImageModel imageModel = aiModel.getImageModel();\n\n// after\nif (!SUPPORTS_IMAGE.contains(aiModel.getModelProvider())) {\n    throw new IllegalArgumentException(\n        \"Provider \" + aiModel.getModelProvider() + \" does not support image generation\");\n}\nImageModel imageModel = aiModel.getImageModel();","handlingStrategy":"validation","validationCode":"// Validate provider supports image generation before calling getImageModel()\nprivate static final Set<String> IMAGE_CAPABLE_PROVIDERS =\n    Set.of(\"openai\", \"azure_openai\", \"vertex_ai\", \"google_gemini\", \"stabilityai\");\n\nvoid validateImageCapability(AIModel provider) {\n    if (!IMAGE_CAPABLE_PROVIDERS.contains(provider.getModelProvider())) {\n        throw new IllegalArgumentException(\n            \"Provider '\" + provider.getModelProvider()\n            + \"' does not support image generation. \"\n            + \"Supported: \" + IMAGE_CAPABLE_PROVIDERS);\n    }\n}","typeGuard":"// Check whether an AIModel instance supports image generation\nstatic boolean supportsImageGeneration(AIModel model) {\n    try {\n        return model.getImageModel() != null;\n    } catch (UnsupportedOperationException e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    ImageModel imageModel = aiModel.getImageModel();\n} catch (UnsupportedOperationException e) {\n    throw new IllegalArgumentException(\n        \"Provider \" + aiModel.getModelProvider()\n        + \" does not support image generation. \"\n        + \"Use openai, azure_openai, vertex_ai, or stabilityai.\", e);\n}","preventionTips":["Maintain a Set<String> of image-capable provider names and check membership before calling getImageModel().","In task definitions, validate the provider field against supported capabilities at workflow-registration time, not at runtime.","Build a capability matrix (provider x capability) in your provider registry so dispatchers can query it before calling."],"tags":["anthropic","image-generation","unsupported-operation","capability-mismatch"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}