Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ml-opensource/chat-gpt-java-poc
https://github.com/ml-opensource/chat-gpt-java-poc
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ml-opensource/chat-gpt-java-poc
- Owner: ml-opensource
- Created: 2023-06-15T12:40:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-06T10:01:39.000Z (over 1 year ago)
- Last Synced: 2024-11-10T22:18:10.771Z (8 days ago)
- Language: Java
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# chat-gpt-java-poc
Provides Sample of How we can integrate ChatGPT into a Java project (Spring Boot).
The project can serve as a POC.## Requirements
* JDK 17
* Any IDE with [lombok](https://projectlombok.org/) plugin installed## How to code
Import as a java project in an IDE of your choice.## Working locally
### How to run the app (local with mvn commands, local Postgres)
Install and configure Postgres locally. For mac follow the [link](https://www.sqlshack.com/setting-up-a-postgresql-database-on-mac/).Install locally a Postgres client (eg [PgAdmin](https://www.pgadmin.org/download/pgadmin-4-macos/) )
Migrate DB via command: `mvn flyway:migrate -Dflyway.url=XXX -Dflyway.user=XXX -Dflyway.password=XXX`
Run `mvn clean install`. This will generate the appropriate jar, that will be run later on.
Before running the app set the following env variables (take advantage of the IDEA run configuration)
`ACTIVE_PROFILE=` dev / qa / prod
`DATABASE_HOST=`
`DATABASE_PORT=`
`DATABASE_NAME=`
`DATABASE_USER=`
`DATABASE_PASSWORD=`
Run `mvn spring-boot:run -f pom.xml`
Access it into a browser at: `{{baseUrl}}/users`