Bug: HTTP 404 Error When Using OpenAI-Compatible Endpoint with Semantic Kernel 1.4.4-RC1
@johnoliver y travaille déjà.
Depuis le 5/8/2025.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Describe the bug
When attempting to use an OpenAI-compatible endpoint (specifically https://api.siliconflow.cn/v1) with Semantic Kernel 1.4.4-RC1, I consistently receive HTTP 404 errors ("404 page not found") regardless of the invocation method.
Code Implementation
OpenAIAsyncClient client = new OpenAIClientBuilder().credential(new KeyCredential("sk-key")).endpoint("https://api.siliconflow.cn/v1").buildAsyncClient();
ChatCompletionService chatService = OpenAIChatCompletion.builder().withModelId("Qwen/Qwen2.5-32B-Instruct").withOpenAIAsyncClient(client).build();
Kernel kernel = Kernel.builder().withAIService(ChatCompletionService.class, chatService).withPlugin(lightPlugin).build();
Error Occurrence
Both invocation methods fail with the same 404 error:
1、Prompt invocation:
kernel.invokePromptAsync(prompt, argss).block();
2、Direct chat service invocation:
chatService.getChatMessageContentsAsync(history, kernel, invocationContext).block();
Error Details
Full stack trace shows:
00:37:50.318 [reactor-http-nio-1] WARN com.azure.core.implementation.serializer.HttpResponseBodyDecoder -- Failed to deserialize the error entity. Unsupported text Content-Type Type: class java.lang.Object Exception in thread "main" com.azure.core.exception.HttpResponseException: Status code 404, "404 page not found" at com.azure.core.implementation.http.rest.RestProxyBase.instantiateUnexpectedException(RestProxyBase.java:381) at com.azure.core.implementation.http.rest.AsyncRestProxy.lambda$ensureExpectedStatus$1(AsyncRestProxy.java:135) at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113) at reactor.core.publisher.MonoUsing$MonoUsingSubscriber.onNext(MonoUsing.java:231) at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:129) at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224) at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113) at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:194) at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) at reactor.core.publisher.Operators$BaseFluxToMonoOperator.completePossiblyEmpty(Operators.java:2096) at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:118) at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260) at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144) at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:413) at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:455) at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:509) at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:821) at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:115) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at com.azure.core.http.netty.implementation.AzureSdkHandler.channelRead(AzureSdkHandler.java:224) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1515) at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1389) at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1429) at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530) at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:796) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:842) Suppressed: java.lang.Exception: #block terminated with an error at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:104) at reactor.core.publisher.Mono.block(Mono.java:1779) at com.example.semantickernel_example.TextGenerationExample.main(TextGenerationExample.java:65) Caused by: java.lang.IllegalStateException: Unsupported text Content-Type Type: class java.lang.Object at com.azure.core.util.serializer.JacksonAdapter.deserializeText(JacksonAdapter.java:453) at com.azure.core.util.serializer.JacksonAdapter.lambda$deserialize$9(JacksonAdapter.java:354) at com.azure.core.util.serializer.JacksonAdapter.useAccessHelper(JacksonAdapter.java:491) at com.azure.core.util.serializer.JacksonAdapter.deserialize(JacksonAdapter.java:347) at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.deserialize(HttpResponseBodyDecoder.java:176) at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.deserializeBody(HttpResponseBodyDecoder.java:150) at com.azure.core.implementation.serializer.HttpResponseBodyDecoder.decodeByteArray(HttpResponseBodyDecoder.java:67) at com.azure.core.implementation.serializer.HttpResponseDecoder$HttpDecodedResponse.getDecodedBody(HttpResponseDecoder.java:93)
Troubleshooting Attempts
1、Verified the endpoint URL is correct and accessible
2、Confirmed the API key is valid
3、Tested the same endpoint with direct HTTP requests (works fine)
4、Tried with different model IDs
5、Verified network connectivity and firewall settings
Expected Behavior
The OpenAI-compatible endpoint should accept requests and return proper responses when used through Semantic Kernel's client.
Environment
Semantic Kernel version: 1.4.4-RC1
Java version: 17
OS: Windows 11 Pro
Additional Context
The endpoint https://api.siliconflow.cn/v1 is confirmed to work with standard OpenAI API requests, suggesting this may be a client configuration or SDK compatibility issue.
Questions
1、Are there any additional configuration requirements for using non-Azure OpenAI endpoints?
2、Is the OpenAIClientBuilderthe correct approach for third-party OpenAI-compatible services?
3、Are there known issues with the 1.4.4-RC1 version regarding custom endpoints?
- Langage dominant
- Java
- Étoiles
- 276
- Forks
- 56
- Merge moyen
- 17 h 45 min
- PR mergées (30 j)
- 4
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/semantic-kernel-java
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
microsoft/semantic-kernel-java#334 · 1 commentaire ·
-
Feature Parity Inquiry: Multi-Agent Orchestration and Roadmap Alignment with Python/.NET Versions Ouverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
microsoft/semantic-kernel-java#331 · 7 commentaires ·
-
agents without chatcompletion ? Ouvertebug triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
microsoft/semantic-kernel-java#328 · 1 commentaire ·
-
Java: Remove SK planners Ouverte
microsoft/semantic-kernel-java#323 · 1 réaction · 2 personnes assignées ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 20/100
microsoft/semantic-kernel-java#302 · 1 commentaire ·
Toutes les issues de microsoft/semantic-kernel-java
Issues similaires
-
Bug Java Platform: Java
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
getsentry/sentry-java#6138 · 1 commentaire ·
-
bug needs triage p2
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 commentaire ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
apache/rocketmq-dashboard#4654 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100