Installation
Get Spice Framework up and running in your project.
Requirementsβ
- Kotlin: 1.9.0 or higher
- JVM: Java 11 or higher
- Build Tool: Gradle (recommended) or Maven
Installation via JitPackβ
Spice Framework is distributed via JitPack, making it easy to integrate into your project.
Step 1: Add JitPack Repositoryβ
Add the JitPack repository to your build configuration:
Gradle (Kotlin DSL)β
// settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Gradle (Groovy)β
// settings.gradle
dependencyResolutionManagement {
repositoriesMode = FAIL_ON_PROJECT_REPOS
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Step 2: Add Dependenciesβ
Add the Spice Framework dependencies to your project:
Core Module (Required)β
// build.gradle.kts
dependencies {
implementation("com.github.no-ai-labs.spice-framework:spice-core:Tag")
}
Replace Tag with the latest version from JitPack:
Optional Modulesβ
Add additional modules based on your needs:
dependencies {
// Core framework (required)
implementation("com.github.no-ai-labs.spice-framework:spice-core:Tag")
// Spring Boot integration (optional)
implementation("com.github.no-ai-labs.spice-framework:spice-springboot:Tag")
// Event sourcing module (optional)
implementation("com.github.no-ai-labs.spice-framework:spice-eventsourcing:Tag")
}
Verify Installationβ
Create a simple test file to verify your installation:
// src/main/kotlin/Test.kt
import io.github.noailabs.spice.dsl.*
import kotlinx.coroutines.runBlocking
fun main() = runBlocking {
val agent = buildAgent {
id = "test-agent"
name = "Test Agent"
description = "Testing Spice installation"
handle { comm ->
comm.reply("Hello from Spice! πΆοΈ", id)
}
}
val response = agent.processComm(
Comm(content = "Hello", from = "user")
)
println(response.content) // Output: Hello from Spice! πΆοΈ
}
Run this file:
./gradlew run
If you see "Hello from Spice! πΆοΈ", congratulations! Spice is successfully installed.
Module Overviewβ
| Module | Description | When to Use |
|---|---|---|
| spice-core | Core framework with agents, tools, DSL | Always required |
| spice-springboot | Spring Boot auto-configuration | When using Spring Boot |
| spice-eventsourcing | Event sourcing and CQRS support | For event-driven architectures |
Next Stepsβ
Now that you have Spice installed, let's create your first agent!
Troubleshootingβ
JitPack Build Issuesβ
If JitPack shows a build error, wait a few minutes for the artifact to build. First-time builds can take 5-10 minutes.
Kotlin Version Conflictsβ
Ensure your project uses Kotlin 1.9.0 or higher:
// build.gradle.kts
kotlin {
jvmToolchain(11)
}
Dependency Resolutionβ
If you encounter dependency resolution issues, try:
./gradlew clean build --refresh-dependencies
Getting Helpβ
- GitHub Issues: Report installation problems
- Discussions: Ask the community