This is a simple Apollo Server wrapped around OpenAI APIs.
The goal of this project is to provide a way to leverage the OpenAI APIs for the purpose of creating an interactive chat bot related to Optimizely's products and offerings.
Make a .env file from .env.example and add OpenAI API key
cp .env.example .env
Setting up the project and running it is as simple as installing the dependencies and running the application:
npm ci && npm start
There are a couple of helper scripts that get called with npm start
:
npm lint; // lints typescript files
npm tsc; // compiles typescript
CAVEATS
Because we're leveraging typescript, it is important to always include the
import file extensions as .js
since that is what they get compiled to! If you
don't do this the compiled application will complain about being unable to find the
imports.
ChatGPT query message:
query chat {
chat(text: "Hello!")
}