A curated list of awesome Kotlin Notebook that can be run instantly in IntelliJ to accelerate building Kotlin experiments, especially GenAI PoC, using 3rd party libraries!
If you are a kotlin beginning, follow the README.md
to run the notebook to learn different libraries.
If you are a java/kotlin library owner, showcase your library using Kotlin Notebook and allow others to run, learn and contribute together!
- Spring AI
- Neo4j
- PostgreSQL
- AWS SDK for Kotlin
- LLM Model Context Protocol for Kotlin(Planned)
- langchain4j(Planned)
- Kotlin new features by version(Planned)
- [GCP SDK(Planned)]
- [Azure SDK(Planned)]
- ... more
- Feel free to share your Kotlin Notebook to accelerate together
You might also interested to read the official Kotlin Notebooks sample.
To ease the dependency version upgrade and minimize manual error, I setup a convention to store dependency version and API secret.
Here is the reference folder structure.
.
└── spring-ai/
├── resources/
│ ├── version.json
│ └── openai.secret.json (openai.example.json for reference)
├── spring-ai-openai.ipynb
└── spring-ai-ollama.ipynb
Load the version.json
variables
%use @file[resources/version.json](currentDir=".")
For example, the following version.json
will create the variables for Kotlin Notebook.
{
"properties": {
"SPRING_AI_VERSION": "1.0.0-M5",
"KOTLIN_COROUTINE_VERSION": "1.9.0",
"REACTOR_VERSION": "3.7.1"
},
"init": [
"val springAiVersion = \"$SPRING_AI_VERSION\"",
"val kotlinCoroutineVersion = \"$KOTLIN_COROUTINE_VERSION\"",
"val reactorVersion = \"$REACTOR_VERSION\""
]
}
In case there is a major version upgrade for the third party library that contains breakchanges. Please create another variable.
{
"properties": {
"SPRING_AI_VERSION": "1.0.0-M5",
+ "SPRING_AI_V2_VERSION": "2.0.0",
"KOTLIN_COROUTINE_VERSION": "1.9.0",
"REACTOR_VERSION": "3.7.1"
},
"init": [
"val springAiVersion = \"$SPRING_AI_VERSION\"",
"val springAiV2Version = \"$SPRING_AI_V2_VERSION\"",
"val kotlinCoroutineVersion = \"$KOTLIN_COROUTINE_VERSION\"",
"val reactorVersion = \"$REACTOR_VERSION\""
]
}
You can write a self-documented notebook that combine source code and run result.
Those results can be directly read on GitHub. Getting started here: https://kotlinlang.org/docs/kotlin-notebook-set-up-env.html