ChatbotWS is a JSR 370 webservice template that lets us spin up Java webservice quickly through GitHub templates. Whether we want to create a chatbot that leverages popular APIs such as ChatGPT or connect to our own custom service, this template can do it all! Explore chatbot.qubitpi.org to view all of its available features, how to use them, examples and more!
- Connect to any API
- Data storage
- Out-of-the-box healthcheck endpoint
- Docusaurus-based documentation site freely hosted on GitHub Pages
- Dockerized webservice
- ELK application monitoring
- Flexible webservice configuration
Please make sure Docker is installed (Installing Docker), then execute this on-click commands:
Important
Please replace the OPENAI_API_KEY
below with the actual key which can be obtained
here
export OPENAI_API_KEY=...
docker run -it -p 8080:8080 -e OPENAI_API_KEY=$OPENAI_API_KEY jack20191124/chatbot-ws
That's it. A healthcheck endpoint can be pinned with
curl -v localhost:8080/v1/healthcheck
which would gave
$ curl -v localhost:8080/v1/healthcheck
* Trying 127.0.0.1:8080...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /v1/healthcheck HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.85.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Length: 0
< Server: Jetty(11.0.15)
<
* Connection #0 to host localhost left intact
curl --location 'http://localhost:8080/v1/openai/chat' --header 'Content-Type: application/json' --data '{
"message": "Hello"
}' -v
Developer can now start adding business values without repeating the time-consuming scaffolding works. To proceed from here, including getting and developing the webservice source code, please refer to the documentation for details.
The use and distribution terms for chatbot-ws are covered by the Apache License, Version 2.0.