search
HomeTechnology peripheralsAIIt 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

It took half an hour to build a WeChat robot based on ChatGPT

It took half an hour to build a WeChat robot based on ChatGPT

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.

It took half an hour to build a WeChat robot based on ChatGPT

Process

To access ChatGPT in WeChat, we need the following steps

  1. Successfully register an OpenAi Account, get an API key;
  2. Run a WeChat robot program based on the open source project wechatbot;
  3. 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.

It took half an hour to build a WeChat robot based on ChatGPT

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.

It took half an hour to build a WeChat robot based on ChatGPT

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.

It took half an hour to build a WeChat robot based on ChatGPT

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!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
Word文本框没有旋转按钮怎么办Word文本框没有旋转按钮怎么办Dec 08, 2022 am 09:50 AM

Word文本框没有旋转按钮的解决办法:打开兼容模式文档后按F12键另存为高版本,再打开就可以了。

令人惊艳的4个ChatGPT项目,开源了!令人惊艳的4个ChatGPT项目,开源了!Mar 30, 2023 pm 02:11 PM

自从 ChatGPT、Stable Diffusion 发布以来,各种相关开源项目百花齐放,着实让人应接不暇。今天,着重挑选几个优质的开源项目分享给大家,对我们的日常工作、学习生活,都会有很大的帮助。

Word文档拆分后的子文档字体格式变了怎么办Word文档拆分后的子文档字体格式变了怎么办Feb 07, 2023 am 11:40 AM

Word文档拆分后的子文档字体格式变了的解决办法:1、在大纲模式拆分文档前,先选中正文内容创建一个新的样式,给样式取一个与众不同的名字;2、选中第二段正文内容,通过选择相似文本的功能将剩余正文内容全部设置为新建样式格式;3、进入大纲模式进行文档拆分,操作完成后打开子文档,正文字体格式就是拆分前新建的样式内容。

学术专用版ChatGPT火了,一键完成论文润色、代码解释、报告生成学术专用版ChatGPT火了,一键完成论文润色、代码解释、报告生成Apr 04, 2023 pm 01:05 PM

用 ChatGPT 辅助写论文这件事,越来越靠谱了。 ChatGPT 发布以来,各个领域的从业者都在探索 ChatGPT 的应用前景,挖掘它的潜力。其中,学术文本的理解与编辑是一种极具挑战性的应用场景,因为学术文本需要较高的专业性、严谨性等,有时还需要处理公式、代码、图谱等特殊的内容格式。现在,一个名为「ChatGPT 学术优化(chatgpt_academic)」的新项目在 GitHub 上爆火,上线几天就在 GitHub 上狂揽上万 Star。项目地址:https://github.com/

30行Python代码就可以调用ChatGPT API总结论文的主要内容30行Python代码就可以调用ChatGPT API总结论文的主要内容Apr 04, 2023 pm 12:05 PM

阅读论文可以说是我们的日常工作之一,论文的数量太多,我们如何快速阅读归纳呢?自从ChatGPT出现以后,有很多阅读论文的服务可以使用。其实使用ChatGPT API非常简单,我们只用30行python代码就可以在本地搭建一个自己的应用。 阅读论文可以说是我们的日常工作之一,论文的数量太多,我们如何快速阅读归纳呢?自从ChatGPT出现以后,有很多阅读论文的服务可以使用。其实使用ChatGPT API非常简单,我们只用30行python代码就可以在本地搭建一个自己的应用。使用 Python 和 C

vscode配置中文插件,带你无需注册体验ChatGPT!vscode配置中文插件,带你无需注册体验ChatGPT!Dec 16, 2022 pm 07:51 PM

​面对一夜爆火的 ChatGPT ,我最终也没抵得住诱惑,决定体验一下,不过这玩意要注册需要外国手机号以及科学上网,将许多人拦在门外,本篇博客将体验当下爆火的 ChatGPT 以及无需注册和科学上网,拿来即用的 ChatGPT 使用攻略,快来试试吧!

用ChatGPT秒建大模型!OpenAI全新插件杀疯了,接入代码解释器一键get用ChatGPT秒建大模型!OpenAI全新插件杀疯了,接入代码解释器一键getApr 04, 2023 am 11:30 AM

ChatGPT可以联网后,OpenAI还火速介绍了一款代码生成器,在这个插件的加持下,ChatGPT甚至可以自己生成机器学习模型了。 ​上周五,OpenAI刚刚宣布了惊爆的消息,ChatGPT可以联网,接入第三方插件了!而除了第三方插件,OpenAI也介绍了一款自家的插件「代码解释器」,并给出了几个特别的用例:解决定量和定性的数学问题;进行数据分析和可视化;快速转换文件格式。此外,Greg Brockman演示了ChatGPT还可以对上传视频文件进行处理。而一位叫Andrew Mayne的畅销作

ChatGPT教我学习PHP中AOP的实现(附代码)ChatGPT教我学习PHP中AOP的实现(附代码)Mar 30, 2023 am 10:45 AM

本篇文章给大家带来了关于php的相关知识,其中主要介绍了我是怎么用ChatGPT学习PHP中AOP的实现,感兴趣的朋友下面一起来看一下吧,希望对大家有帮助。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.