ChatGPT WeChat applet
ChatGPT is a natural language processing platform based on a large language model, providing powerful natural language processing and natural language generation capabilities. This WeChat applet implements the conversation function of the mobile version of the official ChatGPT website, making it convenient for users to use ChatGPT on WeChat for various types of natural language interactions. This WeChat applet can be used with the ChatGPT WebSocket server.
This document was generated and polished by ChatGPT.
Main features
- Powerful language generation and conversation functions based on the official GPT-3.5 API
- The interface and user experience are as close as possible to the official website mobile version
- Access the WeChat content security review interface (cloud development) to ensure content compliance and security
- Use WebSocket to achieve efficient streaming and improve communication efficiency
- Clicking on the conversation content will automatically copy it to the clipboard for user convenience.
- Support forwarding mini programs to chat, making it easier for users to share with friends
- Support sharing mini programs to Moments to facilitate expansion of user base
Build instructions
This WeChat applet is developed natively, written in TypeScript and Less, and uses the TDesign component library.
Download and install
- Clone this project locally.
- Run
npm install
in the project root directory to install the required dependencies.
Build and run
- In WeChat Developer Tools, select "Mini Program Project".
- Click Import Project and select the root directory of this project.
- In the "Tools" menu of WeChat Developer Tools, select "Build npm" to generate the
miniprogram_npm
folder. - Click the "Compile" button to preview the mini program in WeChat Developer Tools.
Configuration
Before you get started, configure the following as needed:
appid
Set the appid
field in the /project.config.json
file to specify the AppID of the applet.
WebSockets
Set the url
field in the /miniprogram/lib/websocket.ts
file to specify the URL of the WebSocket. For example:
const socketTask = wx . connectSocket ( {
url : "wss://yourdomain" ,
} ) ;
Things to note
- Use must comply with corresponding laws and regulations, and bear corresponding legal responsibilities.
Demo
- Search
GPro
applet in WeChat - Scan the mini program code below to experience