A chat application using the OpenAI API along with Convex. In this setup, Convex stores the messages and handles server-side functions for interacting with OpenAI.
This app started with a minimal setup to get React working in Vite with HMR and some ESLint rules and from the official ChatGPT Convex demo.
Features:
- Have a conversation with the Chat GPT API.
- Start new threads to create new conversation with Chat GPT.
- Specify what the chat identity is and change it mid-thread.
- Create new identities/AI agents.
- Moderate user inputs for offensive content by using the moderation API.
demo.mov
convex_demo.mov
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list