Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

tjardoo/openai-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenAI Chat

Introduction

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.

Screenshot

Installation

Prerequisites

Dependencies

Install the following dependencies:

cargo install sqlx-cli
cargo install cargo-watch

Setup

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.

Usage

Production

cd client && npm run build
cargo run

And visit http://localhost:3000.

Development

cd client && npm run watch
cargo watch -x run

And visit http://localhost:5173.

Optional commands:

sqlx migrate revert
sqlx database reset

Currently supported languages

  • javascript
  • php
  • bash
  • css
  • json
  • sql
  • rust
  • python

You can add more languages in client\src\main.ts.

About

Rust/Vue web app to interact with the OpenAI API, featuring code highlighting, message summarization and chat management.

Topics

Resources

Stars

Watchers

Forks