File tree 20 files changed +27
-63
lines changed
dSYMs/YChat.framework.dSYM/Contents
dSYMs/YChat.framework.dSYM/Contents
sample/ios/YChatApp/Features/Completion/ViewModel
androidMain/kotlin/co/yml/ychat/di/module
commonMain/kotlin/co/yml/ychat/di/provider
jvmMain/kotlin/co/yml/ychat/di/module
20 files changed +27
-63
lines changed Original file line number Diff line number Diff line change 11
11
jobs :
12
12
publish-maven :
13
13
name : Publish to Maven
14
- runs-on : ubuntu-latest
14
+ runs-on : macos-11
15
15
steps :
16
16
- name : Checkout
17
17
uses : actions/checkout@v3
31
31
run : chmod +x gradlew
32
32
33
33
- name : Publish to Repository
34
- run : ./gradlew :ychat: clean publish
34
+ run : ./gradlew clean publish --no-parallel --stacktrace
35
35
36
36
env :
37
37
ORG_GRADLE_PROJECT_mavenCentralUsername : ${{ secrets.MAVEN_USERNAME }}
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ repositories {
59
59
Then, simply import the dependency to your ` build.gradle ` dependencies:
60
60
61
61
``` kotlin
62
- implementation(" co.yml:ychat:1.1.0 " )
62
+ implementation(" co.yml:ychat:1.1.1 " )
63
63
```
64
64
65
65
Take a look at the Kotlin code snippet below for an example of how to initialize and use one of the supported features:
Original file line number Diff line number Diff line change 5
5
<key >AvailableLibraries </key >
6
6
<array >
7
7
<dict >
8
- <key >DebugSymbolsPath </key >
9
- <string >dSYMs </string >
10
8
<key >LibraryIdentifier </key >
11
- <string >ios-arm64 </string >
9
+ <string >ios-x86_64-simulator </string >
12
10
<key >LibraryPath </key >
13
11
<string >YChat.framework </string >
14
12
<key >SupportedArchitectures </key >
15
13
<array >
16
- <string >arm64 </string >
14
+ <string >x86_64 </string >
17
15
</array >
18
16
<key >SupportedPlatform </key >
19
17
<string >ios </string >
18
+ <key >SupportedPlatformVariant </key >
19
+ <string >simulator </string >
20
20
</dict >
21
21
<dict >
22
- <key >DebugSymbolsPath </key >
23
- <string >dSYMs </string >
24
22
<key >LibraryIdentifier </key >
25
- <string >ios-x86_64-simulator </string >
23
+ <string >ios-arm64 </string >
26
24
<key >LibraryPath </key >
27
25
<string >YChat.framework </string >
28
26
<key >SupportedArchitectures </key >
29
27
<array >
30
- <string >x86_64 </string >
28
+ <string >arm64 </string >
31
29
</array >
32
30
<key >SupportedPlatform </key >
33
31
<string >ios </string >
34
- <key >SupportedPlatformVariant </key >
35
- <string >simulator </string >
36
32
</dict >
37
33
</array >
38
34
<key >CFBundlePackageType </key >
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ object Dependencies {
34
34
const val KTOR_LOGGING = " io.ktor:ktor-client-logging:${Versions .KTOR } "
35
35
const val KTOR_ANDROID = " io.ktor:ktor-client-android:${Versions .KTOR } "
36
36
const val KTOR_IOS = " io.ktor:ktor-client-ios:${Versions .KTOR } "
37
- const val KTOR_JAVA = " io.ktor:ktor-client-java :${Versions .KTOR } "
37
+ const val KTOR_OKHTTP = " io.ktor:ktor-client-okhttp :${Versions .KTOR } "
38
38
}
39
39
40
40
object DI {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ tasks.register<Delete>("updateSwiftPackage") {
21
21
description = " Updates the Swift package by removing outdated files and running the `createSwiftPackage` task."
22
22
doFirst {
23
23
rootDir.listFiles { file ->
24
- val iosLibraryName = properties[" library.ios.name " ]
24
+ val iosLibraryName = properties[" IOS_NAME " ]
25
25
val fileName = file.name
26
26
if (fileName.startsWith(" $iosLibraryName -" ) && fileName.endsWith(" .zip" )) {
27
27
delete(file)
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ kotlin.mpp.enableCInteropCommonization=true
11
11
# Lib
12
12
GROUP =co.yml
13
13
POM_ARTIFACT_ID =ychat
14
- VERSION_NAME =1.1.0
14
+ VERSION_NAME =1.1.1
15
15
IOS_NAME =YChat
16
16
17
17
# OSS
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ internal final class CompletionViewModel: ObservableObject {
42
42
addLoading ( )
43
43
do {
44
44
if input. contains ( " /image " ) {
45
- let result = try await imageGenerations. execute ( prompt: input) [ 0 ] . url
45
+ let result = try await imageGenerations. execute ( prompt: input) [ 0 ]
46
46
removeLoading ( )
47
47
addAIImage ( url: result)
48
48
} else {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ pluginManagement {
8
8
9
9
dependencyResolutionManagement {
10
10
repositories {
11
+ mavenLocal()
11
12
google()
12
13
mavenCentral()
13
14
}
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ kotlin {
67
67
}
68
68
val androidMain by getting {
69
69
dependencies {
70
- implementation(Dependencies .Network .KTOR_ANDROID )
70
+ implementation(Dependencies .Network .KTOR_OKHTTP )
71
71
}
72
72
}
73
73
val androidTest by getting {
@@ -98,7 +98,7 @@ kotlin {
98
98
}
99
99
val jvmMain by getting {
100
100
dependencies {
101
- implementation(Dependencies .Network .KTOR_JAVA )
101
+ implementation(Dependencies .Network .KTOR_OKHTTP )
102
102
}
103
103
}
104
104
val jvmTest by getting {
Original file line number Diff line number Diff line change 1
1
package co.yml.ychat.di.module
2
2
3
- import io.ktor.client.engine.android.Android
3
+ import io.ktor.client.engine.okhttp.OkHttp
4
4
import org.koin.dsl.module
5
5
6
6
internal actual fun platformModule () = module {
7
- single { Android .create() }
7
+ single { OkHttp .create() }
8
8
}
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package co.yml.ychat.di.provider
2
2
3
3
import io.ktor.client.HttpClient
4
4
import io.ktor.client.engine.HttpClientEngine
5
+ import io.ktor.client.plugins.HttpTimeout
5
6
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
6
7
import io.ktor.client.plugins.defaultRequest
7
8
import io.ktor.client.request.header
@@ -14,6 +15,7 @@ import kotlinx.serialization.json.Json
14
15
internal object NetworkProvider {
15
16
16
17
private const val BASE_URL = " api.openai.com"
18
+ private const val TIMEOUT_MILLIS = 60000L
17
19
18
20
fun provideHttpClient (engine : HttpClientEngine , apiKey : String ): HttpClient {
19
21
return HttpClient (engine) {
@@ -25,6 +27,11 @@ internal object NetworkProvider {
25
27
}
26
28
header(" Authorization" , " Bearer $apiKey " )
27
29
}
30
+ install(HttpTimeout ) {
31
+ requestTimeoutMillis = TIMEOUT_MILLIS
32
+ connectTimeoutMillis = TIMEOUT_MILLIS
33
+ socketTimeoutMillis = TIMEOUT_MILLIS
34
+ }
28
35
install(ContentNegotiation ) {
29
36
json(
30
37
Json {
Original file line number Diff line number Diff line change 1
1
package co.yml.ychat.di.module
2
2
3
- import io.ktor.client.engine.java.Java
3
+ import io.ktor.client.engine.okhttp.OkHttp
4
4
import org.koin.dsl.module
5
5
6
6
internal actual fun platformModule () = module {
7
- single { Java .create() }
7
+ single { OkHttp .create() }
8
8
}
You can’t perform that action at this time.
0 commit comments