The latest ChatGPT website source code, supports Midjourney painting, GPT voice dialogue + GPT-4 picture understanding ability + ChatFile document dialogue summary + DALL-E3 Vincent picture

I. Introduction

The SparkAi creation system is an Ai intelligent question and answer system and Midjourney painting system developed based on ChatGPT. It supports the OpenAI-GPT full model + the domestic AI full model. The overall test of the source code system in this issue is very perfect. It can be said that SparkAi is currently the only domestic ChatGPT docking OpenAI software system. So how to build and deploy AI creation ChatGPT? Let me write a detailed graphic tutorial here! Supports GPT-4-Turbo model, supports DALL-E3 Vincentian graph, supports the latest GPT-4-Turbo model, GPT-4-1106-Preview multi-modal model. Supports GPT-4 picture conversation capability to upload pictures and understand pictures and understand conversations. ChatFile document conversation summary.

"SparkAi system details and construction and deployment documents":

https://www.yuque.com/yuqueyonghutq9yt2/egy0d0/ah9sq89lgl6b7s4w

①Added OpenAI’s TTS voice conversation function

Supports PC browser and mobile phone use (adjust user-side voice interaction, voice input will result in voice reply, text input will result in text reply)

②ChatFile document conversation summary 

③DALL-E3 Vincentian drawing (supports direct dialogue drawing)

④Added support for GPT-4 picture dialogue capabilities

Upload pictures and read them to understand the conversation

1.1AI model questions

1.2 Artificial Intelligence AI Painting

Added Midjourney partial redraw (Vary Region) online editing function

Added support for MJ's latest V6 Beta painting model (V6 Beta model: able to handle longer prompt words, more realistic character effects, and more delicate composition, tone, light and shadow)

Mobile page:

1.1 Core functions of the program

SparkAi system now supports OpenAI GPT full model + domestic AI full model + painting pool system + OpenAI TTS voice dialogue function + document dialogue summary function!

  • AI questioning: The program already supports GPT3.5, GPT4.0 questioning, OpenAIGPT full model + domestic AI full model, and supports GPT online questioning
  • It has supported the OpenAIGPT full model + the domestic AI full model, and has supported the domestic AI models Baidu Wenxinyiyan, Microsoft Azure, Alibaba Cloud Tongyi Qianwen model, Tsinghua Zhipu AIChatGLM, iFlytek Spark model, and Tencent Hunyuan model wait
  • ChatFile document upload conversation function and summary conversation
  • New knowledge base access (connected to Baidu Qianfan Knowledge Base), the client dynamically displays the knowledge base plug-in and chooses to talk to the knowledge base through the plug-in. You can customize training content answers and document summaries, and upload documents as knowledge base content for use Dialogue answers for specific scenarios, such as corporate culture rules and regulations, product description documents, customer service, etc. various industry knowledge bases, etc.
  • Added support for MJ's latest V6 Beta painting model (V6 Beta model: able to handle longer prompt words, more realistic character effects, and more delicate composition, tone, light and shadow)
  • AI painting: Midjourney painting (fully customized parameter adjustment), Midjourney drawing from pictures, Dall-E3 painting
  • Supports the latest GPT-4 multi-modal model, OpenAI GPT-4-Turbo-With-Vision-128K model
  • GPT-4 picture dialogue capability has been supported (upload pictures and recognize the pictures to understand the dialogue), and can support the simultaneous uploading of 5 pictures for dialogue.
  • Dialog plug-in system, plug-in functions will be gradually added in the future to expand AI capabilities
  • The new KEY supports independent configuration of consumption rates. For example, GPT4-32K is more expensive than GPT4 and should consume more quotas.
  • WeChat official account + email + mobile number registration and login
  • One-click intelligent mind map generation
  • The application square supports users to customize the front-end to add private or shared information.
  • AI Painting Square (Gallery)
  • Invitation + agent distribution model, daily user check-in function, and synchronized saving of session records
  • Supports docking with WeChat official payment, Yipay, code payment, Hupijiao payment, etc., and customizes aggregated membership packages
  • Other core functions and subsequent free version feature updates

1.2 Update log

【V4.3.0】Update function (updated on 2023.12.26)

  1. New client chat dialogue plug-in: ChatFile document upload dialogue function and summary dialogue
  2. Optimize TTS request API to support third-party transfer proxy interface
  3. Added support for MJ's latest V6 Beta painting model (V6 Beta model: able to handle longer prompt words, more realistic character effects, and more delicate composition, tone, light and shadow)
  4. Adjust the dialogue request timeout mechanism to avoid error reporting when the plug-in call time is too long (DallE-3 chat painting). Please see the deployment document for how to configure it.
  5. Other optimizations

2. System module demonstration

Quick experience

Official demo site:

3. System function modules

3.1ChatGPT model questions

GPT online questioning has been supported

3.2Prompt application

3.2.1Prompt application

3.2.2 Custom Prompt application

Support user-defined Prompt applications

3.3 Support Midjourney painting

  • Supports synchronized official image regeneration instructions

  • Synchronize the official Vary command to enhance the contrast of a single image Vary(Strong) | Vary(Subtle)

  • Synchronize the official Zoom command to infinitely zoom a single picture Zoom out 2x | Zoom out 1.5x

  • Added Midjourney partial redraw (Vary Region) online editing function

3.3.2 Use pictures to create pictures

3.4Dall-E3 painting

Direct dialogue with Wen Shengtu

3.5 Intelligent mind map generation

3.6AI Gallery

3.6 System background management system

There are too many functions in other and backend pages, so they will not be displayed. Directly visit the demo site and demo backend. 

4. Build and deploy tutorial

4.1 Basic env environment configuration

In the code, we provide the basic environment variable file configuration file env.example . Before using it, remove the suffix and change it to the .env file. We only need to configure the following things in the env environment configuration file.

  • Authorization code authorization ip configuration

  • Mail service configuration

  • These three items of mysql database are basic configurations. Mysql and authorization are necessary. Only when mysql and authorization are configured can the project be started successfully. The mail service can be added later.

4.2env file code

# 服务器ip
SPARK_AI_HOST=
# 授权码
SPARK_AI_KEY=

# mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=数据库用户名
DB_PASS=数据库密码
DB_DATABASE=数据库名
DB_LOG=false
DB_SYNC=true

#  mailer 邮件服务
MAILER_HOST=smtp.163.com
MAILER_PORT=465
MAILER_USER=发信邮箱
MAILER_PASS=邮箱发信密钥
MAILER_FROM=发信邮箱

# Redis
REDIS_PORT=6379
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=
REDIS_DB=0

# jwt token
JWT_SECRET=chat-spark
# jwt token 过期时间
JWT_EXPIRESIN=7d
# 接口文档前缀
SWAGGERPREFIX=/docs
# 自定义端口
PORT=9520

5. Environment installation

Preconditions:

  1. Domestic or overseas servers are available. The minimum configuration is 2H2G and above, and 2H4G or higher is recommended.

  2. Pagoda installed successfully

Required environment:

  • Nginx >= 1.19.8

  • MySQL >= 5.7MySQL 8.0

  • PHP-7.4 (optional)

  • PM2 Manager>=5.5

  • Redis 7.0.11

  • Node version: >=16.19.1

5.1Node version

Use PM2 to switch Node versions (required)

Switch Node version to: v16.19.1

5.2 Install pnpm module

5.3 Install Redis

6. Deploy and run

6.1 Create a new site

Enter Pagoda->Website->Add Site

6.2 Turn on HTTPS

6.2.1 Use your own ssl certificate

6.2.2Let's Encrypt certificate application

If you don't have a certificate, use Pagoda to provide free certificates and apply for Let's Encrypt

6.3 Upload system source code

Delete the default files generated by the pagoda creation site

Upload and unzip the program to the root directory of the website

6.3.1Configure .env file

Double-click the .env.example file directly in the Pagoda to edit it, or edit it in the terminal vim

After the configuration is completed, delete the file suffix and the file name is .env.

6.3.2 Check and verify Node related environment

At this time, open the terminal again and determine whether we need a node-related environment.

node -v
npm -v
pnpm -v

6.4 Start the project

6.4.1 Open the port

Pagoda panel securely opens port 9520 and port 3306

6.4.2 Install dependencies

Use the terminal to switch to the website directory

cd /www/wwwroot/网站目录

Or enter the ssh terminal directly in the root directory of the website

Use the pnpm i command to install dependencies

pnpm i

6.4.3 Start the project

Start the project using the pnpm start command

pnpm start

6.4.4 View startup log

Enter pm2 log to view the detailed log. If you see the picture below, it means success!

pm2 log

6.4.5 Add reverse proxy

Add 9520 port reverse proxy. Pagoda Security needs to open this port, otherwise it will not be accessible.

7. Use the system

Deployment completed! Now you can access the system through the domain name

7.1 Management background

The default front-end address is the domain name address, and the default back-end address is:

https://domain name address/sparkai/admin

The default super administrator account is:

super ,spark123

7.2 Modify the default password of the super administrator

After logging in, please change the default password of the super administrator first.

7.3 Construction completed

8. Backend configuration & system version update

8.1Backend configuration

For system configuration tutorials and other tutorials, please go to the system details deployment document or the original blog tutorial.

https://www.idcyli.com

8.2 system version update

For system version update tutorials, please go to the system details deployment document or the original tutorial on the blog.

Guess you like

Origin blog.csdn.net/weixin_43227851/article/details/135311800