This is a simple test project for the OpenAI API for learning purposes.
Caution
It requires an API key from OpenAI to work and positive credit balance to make requests.
docker-compose up --build
Open http://localhost:3000/
in your browser.
Caution
This project requires bun
to be installed globally.
You can install it using the following commands:
With npm:
npm install -g bun@latest # or
yarn global add bun@latest
After installing bun globally, you can use it as the interpreter for any JavaScript or TypeScript file by running bun in your terminal.
Please note that you might need to add the global npm or yarn directory to your system's PATH if it's not already there. You can do this by adding the following line to your shell profile file (like .bashrc, .bash_profile, or .zshrc):
export PATH=$(npm prefix -g)/bin:$PATH # for npm
export PATH=$(yarn global bin):$PATH # for yarn
- Clone this repository.
- Run
bun install
to install the dependencies.
- Start the server by running
bun dev
. - Open
http://localhost:3000/
in your browser.
express
: A web application framework for Node.js.openai
: The official OpenAI API client.express-rate-limit
: Middleware for rate-limiting incoming requests.express-async-handler
: Middleware for handling exceptions inside async express routes.typescript
: Better than JavaScript.
- Add basic functionality.
- Add rate limiting.
- Add telegram bot.
- Add more features & tests.