It took half an hour to build a WeChat robot based on ChatGPT
I believe that everyone has been attracted by ChatGPT recently. In fact, it was popular once almost a month ago. It seems that it was only popular in the programmer circle and has not been recognized by the public. I don’t know what happened recently. It became popular again because of something, and everyone knew about it this time.
Thinking that such a popular AI can be played for fun, I tried to connect ChatGPT to my personal WeChat to tease the AI in WeChat.
Let’s take a look at some chat screenshots first
You can also join a group for group chat, you can see The training data to ChatGPT is quite old, and some questions still have historical answers. However, as can be seen from the above case, the current effect is much better than before. At least it can be linked to the context. I have to say that this is definitely a milestone.
Process
To access ChatGPT in WeChat, we need the following steps
- Successfully register an OpenAi Account, get an API key;
- Run a WeChat robot program based on the open source project wechatbot;
- Use WeChat to scan the QR code to log in (it is recommended to use a small account);
Registration
OpenAi Due to some reasons, it is impossible to register an account normally in China, and even the website cannot be accessed normally. The detailed registration process is not within the scope of this article. Those who are interested can Reply with the keyword [chatgpt] in the background to view the registration details.
Here I will show you how to obtain an API key after successful registration. When we register successfully and log in, we can go to the link https://platform.openai.com/account/api-keys. Click Create new Secret key on the page to generate an API key. Copy the API key and store it for later use.
Run the robot program
For those with a technical background, there are several ways to run the program. It can be run based on source code or based on docker To run, Ah Fen will run it directly through docker for the sake of simplicity. After installing docker on the service, just run the following command directly.
docker run -itd --name wechatbot --restart=always -e APIKEY=刚刚生成的 API key -e AUTO_PASS=false -e SESSION_TIMEOUT=60s -e MODEL=text-davinci-003 -e MAX_TOKENS=512 -e TEMPREATURE=0.9 -e REPLY_PREFIX=ChatGPT: -e SESSION_CLEAR_TOKEN=下一个问题 docker.mirrors.sjtug.sjtu.edu.cn/qingshui869413421/wechatbot:latest
Normally, after starting, through the docker ps command we can see that there are corresponding docker processes as follows.
Next we enter the container, query the QR code, scan the code to log in, and execute the following two lines of code in sequence. If nothing else, you can see a When the QR code comes out, just scan the code with WeChat to log in (it is recommended to use a small account).
docker exec -it wechatbot bash tail -f -n 50 /app/run.log
After scanning the QR code to log in, we can have fun playing. However, it should be noted that API calls have a quota limit for each account. The current limit for each account is 18 US dollars. So you can just play with it and tease AI. The project address of wechatbot is here https://github.com/qingconglaixueit/wechatbot. Those who are interested can also study it.
Thinking
The emergence of ChatGPT has broken the previous artificial intelligence barrier. Although there are still many shortcomings, I believe that it will be iterated and upgraded in the future. can perform better. At the same time, AI is becoming more and more mature, and I believe that more jobs and skills will be replaced in the future.
For us, the only constant is change, so we must be prepared to accept new things, and at the same time be prepared to deal with the future, and try to make ourselves irreplaceable.
Friends who don’t know how to build can add Afen WeChat according to the following tips. Afen will pull the built robot into a special reader group and you can experience it. The slots are limited on a first-come, first-served basis.
The above is the detailed content of It took half an hour to build a WeChat robot based on ChatGPT. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

The humanoid robot Ameca has been upgraded to the second generation! Recently, at the World Mobile Communications Conference MWC2024, the world's most advanced robot Ameca appeared again. Around the venue, Ameca attracted a large number of spectators. With the blessing of GPT-4, Ameca can respond to various problems in real time. "Let's have a dance." When asked if she had emotions, Ameca responded with a series of facial expressions that looked very lifelike. Just a few days ago, EngineeredArts, the British robotics company behind Ameca, just demonstrated the team’s latest development results. In the video, the robot Ameca has visual capabilities and can see and describe the entire room and specific objects. The most amazing thing is that she can also

In the field of industrial automation technology, there are two recent hot spots that are difficult to ignore: artificial intelligence (AI) and Nvidia. Don’t change the meaning of the original content, fine-tune the content, rewrite the content, don’t continue: “Not only that, the two are closely related, because Nvidia is expanding beyond just its original graphics processing units (GPUs). The technology extends to the field of digital twins and is closely connected to emerging AI technologies. "Recently, NVIDIA has reached cooperation with many industrial companies, including leading industrial automation companies such as Aveva, Rockwell Automation, Siemens and Schneider Electric, as well as Teradyne Robotics and its MiR and Universal Robots companies. Recently,Nvidiahascoll

Editor of Machine Power Report: Wu Xin The domestic version of the humanoid robot + large model team completed the operation task of complex flexible materials such as folding clothes for the first time. With the unveiling of Figure01, which integrates OpenAI's multi-modal large model, the related progress of domestic peers has been attracting attention. Just yesterday, UBTECH, China's "number one humanoid robot stock", released the first demo of the humanoid robot WalkerS that is deeply integrated with Baidu Wenxin's large model, showing some interesting new features. Now, WalkerS, blessed by Baidu Wenxin’s large model capabilities, looks like this. Like Figure01, WalkerS does not move around, but stands behind a desk to complete a series of tasks. It can follow human commands and fold clothes

This week, FigureAI, a robotics company invested by OpenAI, Microsoft, Bezos, and Nvidia, announced that it has received nearly $700 million in financing and plans to develop a humanoid robot that can walk independently within the next year. And Tesla’s Optimus Prime has repeatedly received good news. No one doubts that this year will be the year when humanoid robots explode. SanctuaryAI, a Canadian-based robotics company, recently released a new humanoid robot, Phoenix. Officials claim that it can complete many tasks autonomously at the same speed as humans. Pheonix, the world's first robot that can autonomously complete tasks at human speeds, can gently grab, move and elegantly place each object to its left and right sides. It can autonomously identify objects

Installation steps: 1. Download the ChatGTP software from the ChatGTP official website or mobile store; 2. After opening it, in the settings interface, select the language as Chinese; 3. In the game interface, select human-machine game and set the Chinese spectrum; 4 . After starting, enter commands in the chat window to interact with the software.

The following 10 humanoid robots are shaping our future: 1. ASIMO: Developed by Honda, ASIMO is one of the most well-known humanoid robots. Standing 4 feet tall and weighing 119 pounds, ASIMO is equipped with advanced sensors and artificial intelligence capabilities that allow it to navigate complex environments and interact with humans. ASIMO's versatility makes it suitable for a variety of tasks, from assisting people with disabilities to delivering presentations at events. 2. Pepper: Created by Softbank Robotics, Pepper aims to be a social companion for humans. With its expressive face and ability to recognize emotions, Pepper can participate in conversations, help in retail settings, and even provide educational support. Pepper's

Sweeping and mopping robots are one of the most popular smart home appliances among consumers in recent years. The convenience of operation it brings, or even the need for no operation, allows lazy people to free their hands, allowing consumers to "liberate" from daily housework and spend more time on the things they like. Improved quality of life in disguised form. Riding on this craze, almost all home appliance brands on the market are making their own sweeping and mopping robots, making the entire sweeping and mopping robot market very lively. However, the rapid expansion of the market will inevitably bring about a hidden danger: many manufacturers will use the tactics of sea of machines to quickly occupy more market share, resulting in many new products without any upgrade points. It is also said that they are "matryoshka" models. Not an exaggeration. However, not all sweeping and mopping robots are
