OpenAI Chat is a web app that allows you to interact with the OpenAI API. The application is build in Rust and Vue. The chat history is stored in a MySQL database.
You can easily start a new chat or continue an existing chat via the links in the sidebar. When a code snippet is detected, it will automatically be highlighted using Highlight.js. When enabled, it will automatically summarize the first message and use that as title for the chat. In the dropdown menu, you can edit the title of a chat or delete a chat.
Install the following dependencies:
cargo install sqlx-cli
cargo install cargo-watch
Run the following commands:
sqlx migrate run
cd client && npm install
Copy .env.example
to .env
and update the environment variables.
OPENAI_API_KEY
is required to use the OpenAI API. You can get your API key here: https://platform.openai.com/api-keys.
OPENAI_CHAT_SUMMARY_ENABLED
set this to true
or false
to automatically summarize the first message and use that as title for the chat.
cd client && npm run build
cargo run
And visit http://localhost:3000.
cd client && npm run watch
cargo watch -x run
And visit http://localhost:5173.
Optional commands:
sqlx migrate revert
sqlx database reset
- javascript
- php
- bash
- css
- json
- sql
- rust
- python
You can add more languages in client\src\main.ts
.