{"record":{"id":"c0a9773f0ea3caff","repo":"conductor-oss/conductor","slug":"image-generation-not-supported-by-the-model-yet-c0a977","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/mistral/MistralAI.java","lineNumber":114,"sourceCode":"                        .toolNames(toolNames)\n                        .internalToolExecutionEnabled(false);\n\n        if (input.isJsonOutput()) {\n            builder.responseFormat(\n                    new MistralAiApi.ChatCompletionRequest.ResponseFormat(\"json_object\"));\n        }\n\n        return builder.build();\n    }\n\n    @Override\n    public ChatModel getChatModel() {\n        return this.chatModel;\n    }\n\n    @Override\n    public ImageModel getImageModel() {\n        throw new UnsupportedOperationException(\"Image generation not supported by the model yet\");\n    }\n\n    // Initialization helpers\n\n    private MistralAiApi createMistralAiApi(OkHttpClient httpClient) {\n        OkHttpClient effective =\n                (config.getTimeout() != null)\n                        ? httpClient.newBuilder().readTimeout(config.getTimeout()).build()\n                        : httpClient;\n        var factory =\n                new org.springframework.http.client.OkHttp3ClientHttpRequestFactory(effective);\n        // Needs accept-encoding headers\n        // https://github.com/spring-projects/spring-ai/issues/372\n        return MistralAiApi.builder()\n                .baseUrl(config.getBaseURL())\n                .apiKey(config.getApiKey())\n                .restClientBuilder(\n                        RestClient.builder()","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/mistral/MistralAI.java#L96-L132","documentation":"MistralAI.java throws UnsupportedOperationException from getImageModel(). The Mistral provider wires chat (MistralAiChatModel) and embeddings but no image-generation adapter. AIModel.getImageModel() is abstract (line 141), so MistralAI throws to indicate the gap.","triggerScenarios":"An image-generation Conductor task uses llmProvider=\"mistral\". LLMHelper.generateImage() calls llm.getImageModel() and the provider throws.","commonSituations":"Routing an image task to Mistral expecting it to use Mistral's (now-discontinued) image models; reusing a Mistral chat/embedding provider config for an image task.","solutions":["Switch the image task to a provider that implements a real ImageModel: openai, gemini, azureopenai, stabilityai, bedrock, or cohere.","Keep Mistral for chat and embeddings only.","Contribute a MistralImageModel adapter if Mistral reintroduces an image API."],"exampleFix":"// before\n{\"llmProvider\": \"mistral\", \"prompt\": \"a cat\"}\n// after\n{\"llmProvider\": \"openai\", \"model\": \"dall-e-3\", \"prompt\": \"a cat\"}","handlingStrategy":"validation","validationCode":"// Same IMAGE_CAPABLE set\nprivate static final Set<String> IMAGE_CAPABLE = Set.of(\n    \"openai\", \"gemini\", \"azureopenai\", \"bedrock\", \"stabilityai\", \"cohere\");\n\nif (!IMAGE_CAPABLE.contains(request.getLlmProvider())) {\n    throw new IllegalArgumentException(\n        \"Mistral does not support image generation. Use: \" + IMAGE_CAPABLE);\n}","typeGuard":"null","tryCatchPattern":"try {\n    ImageModel model = llm.getImageModel();\n} catch (UnsupportedOperationException e) {\n    throw new IllegalArgumentException(\"Mistral does not support image generation\", e);\n}","preventionTips":["Keep Mistral for chat and embeddings only.","Route image tasks to openai, gemini, or stabilityai.","Contribute a Mistral image adapter if Mistral reintroduces image generation."],"tags":["mistral","image-generation","unsupported-operation","ai","provider"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}