English | 中文
This project simplify chat content for you using AI.
This project uses the Chat GPT API (gpt-3.5-turbo) and Vercel Edge functions with streaming. It constructs a prompt based on the form and user input, sends it to the GPT-3 API via a Vercel Edge function, then streams the response back to the application.
After cloning the repository, go to OpenAI to create an account and refer to the environment variable instructions to put your API key into a file named .env
.
Then, run the application in the command line and it will be available at http://localhost:3000
.
npm run dev
Environment variable | Description | Required | Optional value |
---|---|---|---|
OPENAI_API_KEY | OpenAI API Key,separate with , when there are multiple |
No | (Get) |
NEXT_PUBLIC_USE_USER_KEY | Whether to use the API key entered by the user | No, default value is true |
true or false |
NEXT_PUBLIC_SECRET | Secret string for the project. Use for generating signatures for API calls | No | null |
Deploy the example using Vercel: