This is the Java implementation of apiRAG.
It is based on the OpenAI Java library by Theo Kanning.
You can run the examples in one of two ways:
- Using the
CmdLineChatBot
which is a simple ChatBot command line application - Using the
SimpleServer
which provides the ChatBot as a Spring Boot application exposed through REST and can be accessed via the frontend defined in../html/chatbot.html
.
For either one you need:
- To set
OPENAI_API_KEY
as an environment variable that contains your OPENAI API key. In the terminal, runexport OPENAI_API_KEY={YOUR TOKEN}
. - Provide the name of the example you want to run as a command line argument (for the server, provide the argument as
--example=[NAME]
). You can find all example definitions in theExamples
enum. - For many examples, you need to run the API locally. Check the api-examples directory for more information on how to run the APIs.
This is a proof-of-concept implementation and the library has not yet been published to Maven Central. Test coverage is minimal. We are working on it.