This is a minimal example of using Vaadin to create a UI for Spring AI.
- OpenAI API key saved as an environment variable
OPENAI_API_KEY
- Java 21 (or beyond), e.g., by SDKman (
sdk u java 21.0.2-tem
)
Run the project using ./mvnw spring-boot:run
and open https://localhost:8080 in your browser.
You can also create a GraalVM native image using ./mvnw package -Pnative -Pproduction native:compile
and run the resulting native image.
Note that you must use a Graal JDK in this case (sdk u java 21.0.2-graal
).