conductor-oss/conductor · error · UnsupportedOperationException

Embeddings are not supported by the Stability AI provider

Error message

Embeddings are not supported by the Stability AI provider

What it means

Thrown by StabilityAI.generateEmbeddings as UnsupportedOperationException. Stability AI is an image-only provider and does not offer an embeddings endpoint, so the AIModel method is intentionally unimplemented.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/providers/stabilityai/StabilityAI.java:164

        return org.springframework.ai.image.ImageOptionsBuilder.builder()
                .model(input.getModel())
                .N(input.getN())
                .height(input.getHeight())
                .width(input.getWidth())
                .responseFormat("b64_json")
                .style(input.getStyle())
                .build();
    }

    @Override
    public ChatModel getChatModel() {
        throw new UnsupportedOperationException(
                "Chat completion is not supported by the Stability AI provider");
    }

    @Override
    public List<Float> generateEmbeddings(EmbeddingGenRequest embeddingGenRequest) {
        throw new UnsupportedOperationException(
                "Embeddings are not supported by the Stability AI provider");
    }

    /**
     * Derive an aspect ratio string from width/height in ImageOptions.
     *
     * <p>The v2beta API accepts aspect ratios like "1:1", "16:9", "9:16", "3:2", "2:3", "4:5",
     * "5:4", "21:9", "9:21". If width and height are both provided, we compute the closest matching
     * ratio. If not provided, defaults to "1:1".
     */
    private static String deriveAspectRatio(ImageOptions options) {
        if (options == null || options.getWidth() == null || options.getHeight() == null) {
            return "1:1";
        }
        int w = options.getWidth();
        int h = options.getHeight();
        if (w <= 0 || h <= 0) {
            return "1:1";

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Route embeddings to an embeddings-capable provider (OpenAI).
  2. Guard generateEmbeddings() with a provider/capability check.
  3. Set the correct llmProvider on the embedding task input.
Defensive patterns

Strategy: validation

Validate before calling

if ("stabilityai".equals(model.getModelProvider())) {
    throw new IllegalArgumentException(
        "Stability AI does not support embeddings");
}
List<Float> emb = model.generateEmbeddings(req);

Type guard

boolean supportsEmbeddings(AIModel m) {
    return !"stabilityai".equals(m.getModelProvider())
        && !"perplexity".equals(m.getModelProvider());
}

Try / catch

try {
    List<Float> emb = model.generateEmbeddings(req);
} catch (UnsupportedOperationException e) {
    // provider lacks embeddings; switch to OpenAI
}

Prevention

When it happens

Trigger: Calling generateEmbeddings() on a StabilityAI instance, or routing an embeddings task to the stabilityai provider.

Common situations: An embedding task whose llmProvider is stabilityai, or generic AIModel code calling generateEmbeddings without a capability check.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/6cb00d3d1c431838. Report an issue: GitHub.