File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
surf-chat-bukkit/src/main/kotlin/dev/slne/surf/chat/bukkit Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import com.openai.client.okhttp.OpenAIOkHttpClientAsync
55import com.openai.models.moderations.Moderation
66import com.openai.models.moderations.ModerationCreateParams
77import com.sksamuel.aedile.core.asLoadingCache
8+ import dev.slne.surf.chat.bukkit.config.aiModerationConfig
89import dev.slne.surf.surfapi.core.api.util.emptyObject2DoubleMap
910import it.unimi.dsi.fastutil.objects.Object2DoubleMap
1011import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap
@@ -16,7 +17,7 @@ import kotlin.time.toJavaDuration
1617val openAiService = OpenAiService ()
1718
1819class OpenAiService {
19- private val client = OpenAIOkHttpClientAsync .fromEnv ()
20+ private val client = OpenAIOkHttpClientAsync .builder().apiKey(aiModerationConfig.apiKey).build ()
2021
2122 val resultCache = Caffeine
2223 .newBuilder()
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ data class AiModerationConfig(
1212 val webhookUrl : String = " " ,
1313 val webhookAvatarUrl : String = " https://i.imgur.com/4vEeYfH.png" ,
1414 val userPanelPrefix : String = " https://support.castcrafter.de/cloud/cloud-players/" ,
15+ val apiKey : String = " "
1516) {
1617
1718 companion object {
You can’t perform that action at this time.
0 commit comments