GithubHelp home page GithubHelp logo

wzc520pyfm / clover-chat-gpt Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 1.25 MB

A simple example of calling the OpenAI inerface, use nuxt

License: MIT License

JavaScript 29.09% Shell 3.16% Vue 64.17% TypeScript 3.57%
ai chat-gpt gptchat nuxt openai vue image-generation

clover-chat-gpt's Introduction

clover-chat-GPT

Quick Start

  1. 注册一个openai帐号,获取token(token获取页: https://beta.openai.com/account/api-keys)
  2. 将你的token替换到composables/openai.ts的第6行
    const configuration = new Configuration({
       organization: "org-mvGmOG9Wjd3szwU5aeeUt9NO",
       apiKey: "your token",
     });

Build Setup

# install dependencies
$ yarn install

# serve with hot reload at localhost:3000
$ yarn dev

# build for production and launch server
$ yarn build
$ yarn start

# generate static project
$ yarn generate

如何部署

以centOS7.x为例(注意:你的服务器所在地区必须能够访问openai!)

  1. 服务器安装git和nginx yum install git nginx -y && nginx
  2. 服务器安装node
    1. curl -sL https://rpm.nodesource.com/setup_16.x | bash - (至少14版本但最好17以下)
    2. yum install -y nodejs
  3. 服务器安装yarn npm install --global yarn
  4. 服务器安装pm2 npm install pm2 -g
  5. 在你喜欢的目录下克隆本项目 git clone https://github.com/wzc520pyfm/clover-chat-GPT.git
  6. 进入项目目录 cd clover-chat-GPT, 更换你的OpenAI_Key(参照QuickStart)
  7. 安装依赖 yarn
  8. 项目打包 yarn build
  9. 启动项目 pm2 start
  10. 项目启动在3000端口, 确保3000端口未被占用, 且服务器安全组放通3000端口
  11. 通过服务器ip:3000即可访问, 若无法访问则使用nginx转发3000端口
  12. 最后可使用nginx配置域名转发
    1.   server {
          listen 5577;
          server_name openai;
          location / {
            proxy_pass http://localhost:3000;
          }
        }
    2. 服务器放通5577端口
    3. 使用ip:5577访问项目

clover-chat-gpt's People

Contributors

wzc520pyfm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

2k13yr

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.