Git Product home page Git Product logo

smallboxkk / chatgpt-vercel Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 1.18 MB

Powered by OpenAI API GPT-4/3.5 and Vercel, support muti text conversations/prompts preset/image generation -- 支持多组文本对话/预设提示/图像生成,由 OpenAI API GPT-4/3.5 和 Vercel 提供支持

Home Page: https://chatgpt-vercel-sample.vercel.app/

License: MIT License

JavaScript 1.67% TypeScript 85.13% CSS 0.48% Astro 12.73%

chatgpt-vercel's Introduction

ChatGPT-Vercel

license

English | 简体中文

Introduction

Building your own ChatGPT website by Vercel, support muti text conversations/preset prompts/images generation. Powered by OpenAI API GPT-4/3.5 and Vercel.

Features

  • Text Conversation
  • Preset Prompts
  • Images Generation
  • Audio

Live Demo

User Guide

You can access the online demo above or deploy it privately for experience.

  • About the conversation. Click the icon at the top left to add a conversation, which has two types:
    • Text conversation:
      • By default, it is a continuous conversation, and each sending will carry the full context.
      • Supports adding preset prompts, type / or click the button at the bottom left to add.
      • Supports model configuration, click the settings icon at the top right to configure.
    • Image generation conversation:
      • Does not support continuous conversation, and each sending will not carry the context.
      • Directly input the image effect you want, for example: a cat.
      • The valid access time of the image link is 2 hours. Please save it in time if necessary.
  • About the history record:
    • When Save all conversations is enabled in the global settings, it will be saved to local cache. By default, it will not be saved.
  • About operation:
    • Press Enter to send, press Shift+Enter to line break
  • About all settings:

Getting Started

1. Create Project

Create Vercel project from a github forked project(recommand) or the following Deploy button.

Deploy with Vercel

2. Set OPENAI_API_KEY

There are three ways to set your openai api key:

  • Set Vercel Environment Variables OPENAI_API_KEY
  • Rename your .env.expample file to .env and set OPENAI_API_KEY
  • Set OPENAI_API_KEY within the page

Configurations

Deployment Configurations

All deployment configurations could be configured in the .env file or in Environment Variables of Vercel

Configuration Default Value Description
OPENAI_API_KEY - Key for API request, how to generate
LANGUAGE en Website language, including prompts. Supported languages: zh/en

Global Configurations

All global configurations will be stored locally

Configuration Default Value Description
OpenAI Api Key - The same with the deployment configuration
Save all conversations false The conversation won't be lost after the page is refreshed
Model gpt-3.5-turbo Model used in api request, supported models
Continuous conversations true Carry the full context for the conversations
Number of generated images 1 The number of images generated in a single image generation conversation

Development

Requirements:

  • NodeJS v16.12.0 or higher
  • pnpm v7 or higher

Proxy

  • By default, local requests for openapi are made through a third-party proxy. If there is no need for a proxy, you can disable local proxy by setting DISABLE_LOCAL_PROXY=true in the .env file. At this point, api.openai.com will be directly requested.

Development:

  • Run pnpm dev
  • Expose port, for example, when using in cloud ide, run pnpm start

Build:

  • Run pnpm build

Contribution

Any contributions are highly appreciated. Here are some tips:

  • To improve the translation or add a new language, modify the lang directory. If adding a new language, you will also need to modify src/utils/i18n.ts.
  • To improve or add new preset prompts, modify the prompts directory.
  • To optimize the API, modify the src/pages/api directory.
  • To optimize page interactions, modify the src/components directory.
  • For new feature support, please open an issue directly.

Credits

License

Based on MIT License

chatgpt-vercel's People

Contributors

lvqq avatar fatdoge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.