Initial Release
Initial Release
This Java-based chat project is designed to provide a real-time messaging experience using an IRIS Cloud SQL database. The application integrates with ChatGPT for enhanced chat functionalities and utilizes Liquibase for database migrations.
Before running the project, make sure you have the following installed:
pom.xml
filegit clone https://github.com/yourusername/chat-project.git
cd StarChat/
You must select the appropriate branch based on your storage choice. Opt for the ‘master’ branch if you’re utilizing local storage and the ‘cloud’ branch for CloudSQL storage. While the functionality remains consistent across both branches, it’s essential to note that Cloud SQL lacks support for Globals. Consequently, the Java Native API won’t function in this scenario. We address this limitation on the ‘cloud’ branch by using a dedicated table instead of Globals.
Also, there is a difference in how the application is connected to the ChatGPT. On the ‘cloud’ branch, we are using ChatGPT`s client, on ‘master’ - Java Gateway Service together with Java Native API.
You have 2 options to set up IRIS storage:
Register on IRIS Cloud SQL and create the Cloud SQL deployment (it can be a trial period). After the account creation follow the instructions to access the cloud storage.
Run Docker (Note: change IRIS password after starting containers):
docker-compose up -d
# Database Configuration DB_HOST=k8s-c8bff1fb-a15...elb.us-east-1.amazonaws.com DB_NAMESPACE=USER DB_PASSWORD=password DB_PORT=443 DB_USER=SQLAdmin SECURITY_LEVEL=10 #Only for Cloud SQL
#SSL
SSL_CONFIG_FILE_PATH=D:\StarChat\certs\SSLConfig.properties #Only for Cloud SQL#File Upload Location
RESOURCE_LOCATION=/D:/StarChat/uploads/
UPLOAD_DIR=D:/StarChat/uploads
#Gateway settings
GATEWAY_HOST=java-gateway
GATEWAY_PORT=55555
Create tables manually using .sql files from src/main/resources/liquibase/ .
Run Liquibase plugin:
mvn liquibase:update
Go to the address http://localhost:3000/
Run Java Gateway (Note: do not forget to specify ‘CHAT_GPT_API_KEY’ in .yml):
docker-compose up -d
Install the package:
zpm "install starchat"
How to use:
write ##class(dc.starchat.ChatGPTMain).GetAnswer("java-gateway", 55555, "ChatGPT", "How do you do")
Pull requests are welcome. For major changes, please open an issue first