
Multifaceted AI tooling library delivering typed agent and tool contracts, streaming text and structured outputs, provider/gateway adapters, embeddings and media primitives, telemetry, mocks, and utilities.
Kotlin Multiplatform port of Vercel AI SDK v6 patterns and public feature areas.
This is a green-room Kotlin rewrite of the architectural contracts, not a TypeScript source translation and not an official Vercel package.
iosX64, iosArm64, and iosSimulatorArm64.Until the first release is published, use a source dependency or publishToMavenLocal:
./gradlew publishToMavenLocaldependencies {
implementation("ai.torad:aisdk-kotlin:0.1.0-SNAPSHOT")
}import ai.torad.aisdk.ToolLoopAgent
import ai.torad.aisdk.stepCountIs
import ai.torad.aisdk.tool
import ai.torad.aisdk.toolSetOf
import ai.torad.aisdk.providers.MockLanguageModel
import kotlinx.serialization.Serializable
import kotlinx.serialization.serializer
@Serializable
data class EmptyInput(val unused: String = "")
val helloTool = tool<EmptyInput, String, Unit>(
name = "hello",
description = "Return a greeting.",
inputSerializer = serializer(),
outputSerializer = serializer(),
) { "Hello from a tool." }
val agent = ToolLoopAgent<Unit, String>(
model = MockLanguageModel.textOnly("Welcome."),
instructions = "Be brief.",
tools = toolSetOf(helloTool),
stopWhen = stepCountIs(3),
)Agent and ToolLoopAgent.tool() definitions, dynamicTool(), schemas, and ToolSet.generateText, streamText, and cold Flow<StreamEvent> streaming.Output.obj, Output.array, Output.choice, and Output.json.generateObject and streamObject.customProvider routing.createGateway, gateway, gateway metadata APIs, gateway errors, provider-executed gateway tool descriptors, and a Ktor-backed KtorGatewayTransport.createOpenAICompatible.DefaultGeneratedFile, pruneMessages, experimental media aliases, and v6 public error types.Provider facades for the AI SDK v6 package ecosystem are folded into this root artifact for now. Future aisdk-provider-* artifacts can split publication boundaries without changing the common contracts.
Use JDK 21 to build the project. JVM and Android bytecode target JVM 17.
./gradlew jvmTest
./gradlew check publishToMavenLocalAndroid publication requires an Android SDK with compile SDK 36 installed.
Apache-2.0. See LICENSE.
Kotlin Multiplatform port of Vercel AI SDK v6 patterns and public feature areas.
This is a green-room Kotlin rewrite of the architectural contracts, not a TypeScript source translation and not an official Vercel package.
iosX64, iosArm64, and iosSimulatorArm64.Until the first release is published, use a source dependency or publishToMavenLocal:
./gradlew publishToMavenLocaldependencies {
implementation("ai.torad:aisdk-kotlin:0.1.0-SNAPSHOT")
}import ai.torad.aisdk.ToolLoopAgent
import ai.torad.aisdk.stepCountIs
import ai.torad.aisdk.tool
import ai.torad.aisdk.toolSetOf
import ai.torad.aisdk.providers.MockLanguageModel
import kotlinx.serialization.Serializable
import kotlinx.serialization.serializer
@Serializable
data class EmptyInput(val unused: String = "")
val helloTool = tool<EmptyInput, String, Unit>(
name = "hello",
description = "Return a greeting.",
inputSerializer = serializer(),
outputSerializer = serializer(),
) { "Hello from a tool." }
val agent = ToolLoopAgent<Unit, String>(
model = MockLanguageModel.textOnly("Welcome."),
instructions = "Be brief.",
tools = toolSetOf(helloTool),
stopWhen = stepCountIs(3),
)Agent and ToolLoopAgent.tool() definitions, dynamicTool(), schemas, and ToolSet.generateText, streamText, and cold Flow<StreamEvent> streaming.Output.obj, Output.array, Output.choice, and Output.json.generateObject and streamObject.customProvider routing.createGateway, gateway, gateway metadata APIs, gateway errors, provider-executed gateway tool descriptors, and a Ktor-backed KtorGatewayTransport.createOpenAICompatible.DefaultGeneratedFile, pruneMessages, experimental media aliases, and v6 public error types.Provider facades for the AI SDK v6 package ecosystem are folded into this root artifact for now. Future aisdk-provider-* artifacts can split publication boundaries without changing the common contracts.
Use JDK 21 to build the project. JVM and Android bytecode target JVM 17.
./gradlew jvmTest
./gradlew check publishToMavenLocalAndroid publication requires an Android SDK with compile SDK 36 installed.
Apache-2.0. See LICENSE.