conductor-oss/conductor · error · RuntimeException

Embeddings API call failed: {message}

Error message

Embeddings API call failed: {message}

What it means

AzureOpenAI.generateEmbeddings() wraps any IOException from OpenAIEmbeddingsApi.createEmbeddings() into a RuntimeException. The underlying I/O cause is preserved. Note that this only wraps transport-layer failures; HTTP error responses from the Azure embeddings endpoint are handled inside createEmbeddings and surface as IOExceptions that then get wrapped here.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/providers/azureopenai/AzureOpenAI.java:90

    public String getModelProvider() {
        return NAME;
    }

    @Override
    public List<Float> generateEmbeddings(EmbeddingGenRequest embeddingGenRequest) {
        try {
            var request =
                    new OpenAIEmbeddingsApi.EmbeddingRequest(
                            embeddingGenRequest.getModel(),
                            embeddingGenRequest.getText(),
                            embeddingGenRequest.getDimensions());
            var result = embeddingsApi.createEmbeddings(request);
            if (result.data() != null && !result.data().isEmpty()) {
                return result.data().getFirst().embedding();
            }
            return List.of();
        } catch (IOException e) {
            throw new RuntimeException("Embeddings API call failed: " + e.getMessage(), e);
        }
    }

    @Override
    public ChatOptions getChatOptions(ChatCompletion input) {
        List<Tool> tools = convertTools(input);

        // Azure uses deployment name as the model
        String model = input.getModel();

        OpenAIResponsesChatOptions.OpenAIResponsesChatOptionsBuilder builder =
                OpenAIResponsesChatOptions.builder()
                        .model(model)
                        .topP(input.getTopP())
                        .frequencyPenalty(input.getFrequencyPenalty())
                        .presencePenalty(input.getPresencePenalty())
                        .maxTokens(input.getMaxTokens())
                        .stopSequences(input.getStopWords())

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Inspect getCause() for the specific IOException detail.
  2. Verify the Azure OpenAI base URL — AzureOpenAI auto-appends '/openai/v1', so the config should be the bare resource URL (e.g. https://my-resource.openai.azure.com).
  3. Confirm the 'model' value in the embedding request is the deployment name of an embeddings model (text-embedding-ada-002, text-embedding-3-large, etc.) in that Azure resource.
  4. Verify the api-key header value matches the Azure resource key.
  5. Check the Azure resource is active (not paused) in the Azure portal.

Example fix

// before — using bare model name that may not be a deployment
EmbeddingGenRequest req = new EmbeddingGenRequest("text-embedding-ada-002", text, null);

// after — use the Azure deployment name explicitly
EmbeddingGenRequest req = new EmbeddingGenRequest("my-embedding-deployment", text, null);
Defensive patterns

Strategy: retry

Validate before calling

// Validate Azure OpenAI embedding config before calling
void validateAzureEmbeddingConfig(AzureOpenAIConfiguration config, String model) {
    if (config.getApiKey() == null || config.getApiKey().isBlank()) {
        throw new IllegalArgumentException("Azure OpenAI API key required");
    }
    if (config.getBaseURL() == null || !config.getBaseURL().contains("openai.azure.com")) {
        throw new IllegalArgumentException(
            "Azure OpenAI base URL must be an azure resource URL");
    }
    if (model == null || model.isBlank()) {
        throw new IllegalArgumentException(
            "Embedding deployment name required as model");
    }
}

Try / catch

try {
    return azureOpenAI.generateEmbeddings(request);
} catch (RuntimeException e) {
    if (e.getCause() instanceof java.io.IOException && isTransient(e)) {
        Thread.sleep(backoffMs);
        return azureOpenAI.generateEmbeddings(request); // retry once
    }
    throw new RuntimeException(
        "Azure embeddings failed — verify deployment name and base URL", e);
}

Prevention

When it happens

Trigger: Transport failure during the POST to the Azure OpenAI embeddings endpoint ({baseUrl}/embeddings). Connection timeout, read timeout, DNS failure for the Azure resource endpoint, or the Azure resource is paused/deprovisioned.

Common situations: Base URL misconfigured — missing the /openai/v1 suffix that toAzureV1Url() appends (so the endpoint path resolves wrong). Deployment name (used as 'model') doesn't correspond to an embeddings deployment in the Azure resource. Azure API key rotated but Conductor config not updated. Network proxy blocking the Azure endpoint.

Related errors


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