{"record":{"id":"e5fe38e7a245301f","repo":"conductor-oss/conductor","slug":"embeddings-api-call-failed-message","errorCode":null,"errorMessage":"Embeddings API call failed: {message}","messagePattern":"Embeddings API call failed: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/azureopenai/AzureOpenAI.java","lineNumber":90,"sourceCode":"    public String getModelProvider() {\n        return NAME;\n    }\n\n    @Override\n    public List<Float> generateEmbeddings(EmbeddingGenRequest embeddingGenRequest) {\n        try {\n            var request =\n                    new OpenAIEmbeddingsApi.EmbeddingRequest(\n                            embeddingGenRequest.getModel(),\n                            embeddingGenRequest.getText(),\n                            embeddingGenRequest.getDimensions());\n            var result = embeddingsApi.createEmbeddings(request);\n            if (result.data() != null && !result.data().isEmpty()) {\n                return result.data().getFirst().embedding();\n            }\n            return List.of();\n        } catch (IOException e) {\n            throw new RuntimeException(\"Embeddings API call failed: \" + e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public ChatOptions getChatOptions(ChatCompletion input) {\n        List<Tool> tools = convertTools(input);\n\n        // Azure uses deployment name as the model\n        String model = input.getModel();\n\n        OpenAIResponsesChatOptions.OpenAIResponsesChatOptionsBuilder builder =\n                OpenAIResponsesChatOptions.builder()\n                        .model(model)\n                        .topP(input.getTopP())\n                        .frequencyPenalty(input.getFrequencyPenalty())\n                        .presencePenalty(input.getPresencePenalty())\n                        .maxTokens(input.getMaxTokens())\n                        .stopSequences(input.getStopWords())","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/azureopenai/AzureOpenAI.java#L72-L108","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect getCause() for the specific IOException detail.","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).","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.","Verify the api-key header value matches the Azure resource key.","Check the Azure resource is active (not paused) in the Azure portal."],"exampleFix":"// before — using bare model name that may not be a deployment\nEmbeddingGenRequest req = new EmbeddingGenRequest(\"text-embedding-ada-002\", text, null);\n\n// after — use the Azure deployment name explicitly\nEmbeddingGenRequest req = new EmbeddingGenRequest(\"my-embedding-deployment\", text, null);","handlingStrategy":"retry","validationCode":"// Validate Azure OpenAI embedding config before calling\nvoid validateAzureEmbeddingConfig(AzureOpenAIConfiguration config, String model) {\n    if (config.getApiKey() == null || config.getApiKey().isBlank()) {\n        throw new IllegalArgumentException(\"Azure OpenAI API key required\");\n    }\n    if (config.getBaseURL() == null || !config.getBaseURL().contains(\"openai.azure.com\")) {\n        throw new IllegalArgumentException(\n            \"Azure OpenAI base URL must be an azure resource URL\");\n    }\n    if (model == null || model.isBlank()) {\n        throw new IllegalArgumentException(\n            \"Embedding deployment name required as model\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    return azureOpenAI.generateEmbeddings(request);\n} catch (RuntimeException e) {\n    if (e.getCause() instanceof java.io.IOException && isTransient(e)) {\n        Thread.sleep(backoffMs);\n        return azureOpenAI.generateEmbeddings(request); // retry once\n    }\n    throw new RuntimeException(\n        \"Azure embeddings failed — verify deployment name and base URL\", e);\n}","preventionTips":["Confirm the Azure resource URL is the bare endpoint (https://my-resource.openai.azure.com) — toAzureV1Url() appends /openai/v1 automatically.","Verify the model field is the Azure deployment name of an embeddings model, not the base model name.","Ensure the API key matches the Azure resource (keys are per-resource, not per-deployment).","Check the Azure resource is active and not paused in the Azure portal."],"tags":["azure-openai","embeddings","network","io","deployment"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}