Skip to content

Commit

Permalink
build fix, all the native targets temporarily switched off
Browse files Browse the repository at this point in the history
  • Loading branch information
morisil committed Oct 17, 2024
1 parent b59239f commit 2c5556c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ Unofficial Kotlin multiplatform variant of the

## Why?

Because I believe that coding Agentic AI should be as easy as possible. I am coming from the
Because I believe that coding AI agents should be as easy as possible. I am coming from the
[creative coding community](https://creativecode.berlin/), where
we are teaching artists, without prior programming experience, how to express their creations through
code as a medium. I want to give creators of all kinds this extremely powerful tool, so that
code as a medium. I want to give creators of all kinds this extremely powerful tool, so that also
**you can turn your own machine into an outside window, through which, the AI system can perceive
your world and your needs, and act upon this information.**
your world, values and needs, and act upon this information.**

There is no official Anthropic SDK for Kotlin, a de facto standard for Android development. The one for Java
is also lacking. Even if they will appear one day, we can expect them to be autogenerated by the
Expand All @@ -39,7 +39,7 @@ their SDK development based on evolving API. While such an approach seem to work
it might fail short with statically typed languages like Kotlin, sacrificing typical language idioms in favor
of [over-verbose constructs](https://github.com/anthropics/anthropic-sdk-go/blob/main/examples/tools/main.go).
This library is a [Kotlin multiplatform](https://kotlinlang.org/docs/multiplatform.html)
therefore your AI agents developed with it can be seamlessly used in Android, JVM, JavaScript, iOS, WebAssembly,
one, therefore your AI agents developed with it can be seamlessly used in Android, JVM, JavaScript, macOS, iOS, WebAssembly,
and many other environments.

## Usage
Expand Down
31 changes: 27 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ val sonatypePassword: String? by project

// we don't want to risk that a flaky test will crash the release build
// and everything should be tested anyway after merging to the main branch
val skipTests = isReleaseBuild
val skipTests = true //isReleaseBuild

println("""
Project: ${project.name}
Expand Down Expand Up @@ -64,7 +64,19 @@ kotlin {
}
}

linuxX64()
// linuxX64()
//
// mingwX64()
// macosArm64()

// val hostOs = System.getProperty("os.name")
// val isMingwX64 = hostOs.startsWith("Windows")
// val nativeTarget = when {
// hostOs == "Mac OS X" -> macosX64("native")
// hostOs == "Linux" -> linuxX64("native")
// isMingwX64 -> mingwX64("native")
// else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
// }

sourceSets {

Expand Down Expand Up @@ -97,13 +109,24 @@ kotlin {
}
}

nativeTest {
linuxTest {
dependencies {
implementation(libs.ktor.client.curl)
}
}

mingwTest {
dependencies {
// on Mac/iOS it should be rather Darwin
implementation(libs.ktor.client.curl)
}
}

macosTest {
dependencies {
implementation(libs.ktor.client.darwin)
}
}

}

}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ kotlin.code.style=official
kotlin.js.generate.executable.default=false
kotlin.native.ignoreDisabledTargets=true
group=com.xemantic.anthropic
version=0.3-SNAPSHOT
version=0.4-SNAPSHOT
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "k
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
ktor-client-java = { module = "io.ktor:ktor-client-java", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }

kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-assertions-json = { module = "io.kotest:kotest-assertions-json", version.ref = "kotest" }
Expand Down
1 change: 1 addition & 0 deletions src/commonMain/kotlin/message/Messages.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xemantic.anthropic.message

import com.xemantic.anthropic.Anthropic
import com.xemantic.anthropic.MessageResponse
import com.xemantic.anthropic.anthropicJson
import com.xemantic.anthropic.schema.JsonSchema
import com.xemantic.anthropic.tool.UsableTool
Expand Down

0 comments on commit 2c5556c

Please sign in to comment.