This project is a JavaFX-based chat application that integrates with OpenAI's GPT models to provide intelligent responses to user queries. It uses a MySQL database to store chat history.
- Chat interface for user interaction.
- Integration with OpenAI's GPT models for generating responses.
- Database support for storing chat history.
- Customizable UI with CSS.
- Java 17 or higher.
- Maven for dependency management and project build.
- MySQL database for storing chat history.
Explanation of the workflow can be found in workflow-depth.md.
Start by cloning the repository to your local machine:
git clone https://github.com/yesbhautik/JavaGPT.git
cd JavaGPT
- Navigate to
src/main/resources/
. - Rename
example.db.properties
todb.properties
. - Open
db.properties
and update the following properties with your MySQL database details:
db.url=jdbc:mysql://HOST:PORT/DATABASENAME?zeroDateTimeBehavior=CONVERT_TO_NULL
db.user=USERNAME
db.password=PASSWORD
Run the following SQL script to create the necessary table in your MySQL database:
CREATE TABLE chat_messages (
id INT AUTO_INCREMENT PRIMARY KEY,
timestamp VARCHAR(255) NOT NULL,
question TEXT NOT NULL,
answer TEXT NOT NULL,
finished BOOLEAN NOT NULL
);
- Navigate to
src/main/resources/
. - Rename
example.api.properties
toapi.properties
. - Open
api.properties
and update the following properties with your OpenAI API details:
openai.api.key=YOUR_OPENAI_API
Navigate to root directory
of project and run following command:
mvn javafx:run
After launching the application, you can start interacting with JavaGPT by typing questions into the input field and pressing the "Search" button or the Enter key. Your chat history will be saved and can be viewed upon restarting the application.
Contributions are welcome. Please open an issue first to discuss what you would like to change or add.
This project is open-source and available under the MIT License.