You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following line always fails, despite being provided the dependencies in build.gradle.kts
val openAI = OpenAI("my-api-key")
Steps to Reproduce
Create a new Jetbrains plugin using their plugin template
Add the dependencies the following way: dependencies { implementation(platform("com.aallam.openai:openai-client-bom:3.5.0")) implementation("com.aallam.openai:openai-client") implementation("io.ktor:ktor-client-okhttp") }
Try creating an OpenAI object with a valid api key
Environment
openai-kotlin version: 3.5.0
Kotlin version: 1.9.10 (but tried with lower versions)
OS: win 11
Additional Info
The error message and call stack:
java.util.ServiceConfigurationError: io.ktor.client.HttpClientEngineContainer: io.ktor.client.engine.cio.CIOEngineContainer not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1295) at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1328) at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1319) at io.ktor.client.HttpClientJvmKt.<clinit>(HttpClientJvm.kt:39) at com.aallam.openai.client.internal.HttpClientKt.createHttpClient(HttpClient.kt:24) at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:61) at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:41) at com.aallam.openai.client.OpenAIKt.OpenAI$default(OpenAI.kt:31) at myplugin.MyClass.actionPerformed(XYAction.kt:39)
It is a jetbrains IDE plugin, if that matters.
The text was updated successfully, but these errors were encountered:
Thanks! Where can I exactly find JavaHttpEngine and JavaHttpConfig? What should I include?
Edit: it worked when using implementation instead of runtime, now I get another error regarding loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory
Description
The following line always fails, despite being provided the dependencies in build.gradle.kts
val openAI = OpenAI("my-api-key")
Steps to Reproduce
dependencies { implementation(platform("com.aallam.openai:openai-client-bom:3.5.0")) implementation("com.aallam.openai:openai-client") implementation("io.ktor:ktor-client-okhttp") }
Environment
Additional Info
The error message and call stack:
java.util.ServiceConfigurationError: io.ktor.client.HttpClientEngineContainer: io.ktor.client.engine.cio.CIOEngineContainer not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at kotlin.collections.CollectionsKt___CollectionsKt.toCollection(_Collections.kt:1295) at kotlin.collections.CollectionsKt___CollectionsKt.toMutableList(_Collections.kt:1328) at kotlin.collections.CollectionsKt___CollectionsKt.toList(_Collections.kt:1319) at io.ktor.client.HttpClientJvmKt.<clinit>(HttpClientJvm.kt:39) at com.aallam.openai.client.internal.HttpClientKt.createHttpClient(HttpClient.kt:24) at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:61) at com.aallam.openai.client.OpenAIKt.OpenAI(OpenAI.kt:41) at com.aallam.openai.client.OpenAIKt.OpenAI$default(OpenAI.kt:31) at myplugin.MyClass.actionPerformed(XYAction.kt:39)
It is a jetbrains IDE plugin, if that matters.
The text was updated successfully, but these errors were encountered: