{"record":{"id":"875105b3c78a71f4","repo":"conductor-oss/conductor","slug":"not-supported-875105","errorCode":null,"errorMessage":"Not supported","messagePattern":"Not supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/huggingface/HuggingFace.java","lineNumber":67,"sourceCode":"    }\n\n    public HuggingFace(HuggingFaceConfiguration config, OkHttpClient httpClient) {\n        this.config = config;\n        // Bearer auth (azureAuth=false via the 3-arg constructor). baseURL is the\n        // router /v1 root; the client appends /responses.\n        OpenAIResponsesApi responsesApi =\n                new OpenAIResponsesApi(httpClient, config.getApiKey(), config.getBaseURL());\n        this.chatModel = new OpenAIResponsesChatModel(responsesApi);\n    }\n\n    @Override\n    public String getModelProvider() {\n        return NAME;\n    }\n\n    @Override\n    public List<Float> generateEmbeddings(EmbeddingGenRequest embeddingGenRequest) {\n        throw new UnsupportedOperationException(\"Not supported\");\n    }\n\n    @Override\n    public ChatOptions getChatOptions(ChatCompletion input) {\n        List<Tool> tools = convertTools(input);\n        return OpenAIResponsesChatOptions.builder()\n                .model(input.getModel())\n                .temperature(input.getTemperature())\n                .topP(input.getTopP())\n                .frequencyPenalty(input.getFrequencyPenalty())\n                .presencePenalty(input.getPresencePenalty())\n                .maxTokens(input.getMaxTokens())\n                .stopSequences(input.getStopWords())\n                .jsonOutput(input.isJsonOutput())\n                .responsesApiTools(tools.isEmpty() ? null : tools)\n                .build();\n    }\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/huggingface/HuggingFace.java#L49-L85","documentation":"HuggingFace.java throws UnsupportedOperationException from generateEmbeddings() with message \"Not supported\". HuggingFace is wired to OpenAI Responses API for chat (see constructor at line 60-62), but embeddings are not implemented. AIModel.generateEmbeddings() (line 97) is abstract, so the provider must override it — HuggingFace declines by throwing. Called via LLMHelper.generateEmbeddings() which delegates directly to llm.generateEmbeddings().","triggerScenarios":"A VectorDB worker or LLMEmbeddingGen task is configured with llmProvider=\"huggingface\". VectorDBWorkers.generateEmbeddings() (line 75) or LLMWorkers calls llm.generateEmbeddings(), which throws UnsupportedOperationException before any HTTP request.","commonSituations":"Using HuggingFace TGI (Text Generation Inference) for chat but routing an embedding/indexing pipeline to the same provider; assuming HuggingFace's inference endpoints cover embeddings (they do have an embedding API but this provider doesn't wire it).","solutions":["Route the embedding task to a provider that implements generateEmbeddings(): openai, gemini, azureopenai, bedrock, ollama, or cohere.","If you need HuggingFace embeddings, subclass HuggingFace and implement generateEmbeddings() by calling HuggingFace's /embeddings or sentence-transformers endpoint.","Split workflow: use HuggingFace for chat, openai/ollama for embedding."],"exampleFix":"// before\n{\"llmProvider\": \"huggingface\", \"model\": \"bge-large-en\", \"text\": \"hello\"}\n// after\n{\"llmProvider\": \"openai\", \"model\": \"text-embedding-3-small\", \"text\": \"hello\"}","handlingStrategy":"validation","validationCode":"// Check provider supports embeddings before calling generateEmbeddings()\nprivate static final Set<String> EMBEDDING_CAPABLE = Set.of(\n    \"openai\", \"gemini\", \"azureopenai\", \"bedrock\", \"ollama\", \"cohere\", \"mistral\");\n\nString provider = request.getLlmProvider();\nif (!EMBEDDING_CAPABLE.contains(provider)) {\n    throw new IllegalArgumentException(\n        \"Provider '\" + provider + \"' does not support embeddings. \" +\n        \"Supported: \" + EMBEDDING_CAPABLE);\n}","typeGuard":"null","tryCatchPattern":"try {\n    List<Float> embeddings = llm.generateEmbeddings(request);\n} catch (UnsupportedOperationException e) {\n    throw new IllegalArgumentException(\n        \"Provider '\" + providerName + \"' does not support embeddings: \" + e.getMessage(), e);\n}","preventionTips":["Maintain a capability set for embeddings-capable providers.","Validate the provider when configuring vector-store/indexing workflows.","Use a dedicated embeddings provider config separate from chat provider config."],"tags":["huggingface","embeddings","unsupported-operation","ai","provider"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}