Skip to content

Commit dfd9cad

Browse files
committed
build: 1.3.0
1 parent ba37868 commit dfd9cad

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ plugins {
77
}
88

99
group = "xyz.cssxsh.mirai"
10-
version = "1.2.3"
10+
version = "1.3.0"
1111

1212
mavenCentralPublish {
1313
useCentralS01()

src/main/kotlin/xyz/cssxsh/mirai/openai/MiraiOpenAiPlugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public object MiraiOpenAiPlugin : KotlinPlugin(
1818
JvmPluginDescription(
1919
id = "xyz.cssxsh.mirai.plugin.mirai-openai-plugin",
2020
name = "mirai-openai-plugin",
21-
version = "1.2.3",
21+
version = "1.3.0",
2222
) {
2323
author("cssxsh")
2424
}

src/test/kotlin/xyz/cssxsh/openai/OpenAiClientTest.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package xyz.cssxsh.openai
22

33
import kotlinx.coroutines.*
44
import org.junit.jupiter.api.*
5+
import org.junit.jupiter.api.condition.*
56
import xyz.cssxsh.openai.image.*
67

78
internal class OpenAiClientTest {
@@ -26,6 +27,7 @@ internal class OpenAiClientTest {
2627
}
2728

2829
@Test
30+
@EnabledIfEnvironmentVariable(named = "CI", matches = "true")
2931
fun completions(): Unit = runBlocking {
3032
val model = "text-davinci-003"
3133
val completion = client.completion.create(model) {
@@ -52,4 +54,19 @@ internal class OpenAiClientTest {
5254
fun files(): Unit = runBlocking {
5355
val files = client.file.list()
5456
}
57+
58+
@Test
59+
@EnabledIfEnvironmentVariable(named = "CI", matches = "true")
60+
fun chat(): Unit = runBlocking {
61+
val model = "gpt-3.5-turbo-0301"
62+
val chat = client.chat.create(model) {
63+
messages {
64+
user(content = "Hello!")
65+
}
66+
}
67+
68+
Assertions.assertEquals(model, chat.model)
69+
Assertions.assertFalse(chat.choices.isEmpty())
70+
Assertions.assertNotNull(chat.choices.first().message)
71+
}
5572
}

0 commit comments

Comments
 (0)