This is a simple demonstration of how to use the OpenAI chat client in a Spring Boot application.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You need to have the following installed on your machine:
- Java 21
- Gradle
- IntelliJ IDEA 2023.3.3 or any other IDE that supports Spring Boot
- Clone the repository to your local machine.
- Open the project in your IDE.
- Add your OpenAI API key to the
.env
file asOPENAI_API_KEY
.
Use the run configuration stored in .run/SpringAiDemoApplication.run.xml
to start the application.
This application demonstrates the usage of OpenAI's chat client in a Spring Boot application. It uses the OpenAI API key from the .env
file to authenticate with the OpenAI service.