Home  >  Article  >  Technology peripherals  >  It took another half an hour to connect ChatGPT to DingTalk robot.

It took another half an hour to connect ChatGPT to DingTalk robot.

王林
王林forward
2023-04-11 21:43:011354browse

The previous article introduced you how to use ChatGPT in personal WeChat, but everyone knows that this operation is risky, so everyone is asked to use the trumpet. Today I will introduce to you how to use ChatGPT in DingTalk. Use bots to tease AI.

Process

  1. Register a DingTalk developer platform account and create an internal organization;
  2. Create a robot in the internal organization;
  3. Register OpenAi account and obtain Api Key;
  4. Deploy program in server;
  5. Tease AI in internal group;

Create robot

The first two steps above are mainly to create an internally organized robot. Log in to the DingTalk developer backend https://open-dev.dingtalk.com/?spm=ding_open_doc.document.0.0.7f49263crfKgSY, and select Application Development > Enterprise Internal Development > Robots, click Create Application.

It took another half an hour to connect ChatGPT to DingTalk robot.

Before this, you need to make sure that your DingTalk account has joined an organization. If not, you can create an organization by yourself. After clicking Create Application, fill in the relevant information

It took another half an hour to connect ChatGPT to DingTalk robot.

and then configure the callback address of the robot in the development management menu, which is the address and port of the server where the code will be deployed later, as follows As shown in the figure.

It took another half an hour to connect ChatGPT to DingTalk robot.

In addition to directly using the IP of the server, you can also configure a specific domain name, but this requires a domain name, and you can also configure HTTPS. This is according to everyone If you want to use it yourself, using IP directly is the simplest way at that time.

But configuring a domain name is relatively simple, just apply for a domain name, and then configure an nginx reverse proxy. If HPPTS is needed, just configure a certificate.

Then publish the robot in the version management and release menu. At this time, a debugging group will be automatically created. You can then debug the robot directly in the debugging group. If there are no problems in debugging, you can use it in other internal groups. The robot has been added to .

Register OpenAi

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 beyond the scope of this article. .

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 another half an hour to connect ChatGPT to DingTalk robot.

Deployment service

Deployment service is still as simple as before. We still deploy it through docker. Just one line of command. Done, here you can configure the custom port and the API Key obtained above, as well as the corresponding timeout and Session status instructions.

docker run -itd --name chatgpt -p 9999:9999 
-e APIKEY=你的 API key 
-e SESSIONTIMEOUT=60s 
-e MODEL=text-davinci-003 
-e MAX_TOKENS=512 
-e TEMPREATURE=0.9 
-e SESSION_CLEAR_TOKEN=清空会话 
--rm 
docker.mirrors.sjtug.sjtu.edu.cn/eryajf/chatgpt-dingtalk:latest

After the command is executed successfully, we can see through docker ps that the service is back to normal.

It took another half an hour to connect ChatGPT to DingTalk robot.

After the service deployment is successful, we can locally test whether a port can be connected through the telnet ip port​ command. If Escape character is '^]' appears. characters means it is open. If the link cannot be connected, it may be that the server port is not allowed or the firewall is not turned on. You can check it in sequence.

Teasing AI

After setting up the robot, we can have fun teasing it. Ah Fan did the following teasing, and the effect was still great.

It took another half an hour to connect ChatGPT to DingTalk robot.

Recently there are some articles on the Internet saying that this AI has passed Google’s interview and is said to be able to replace engineers. A fan is not too worried about this. , at least not in the short term. Although passing the interview does not mean that you can do a good job. The part of catching up with engineers is only based on some theories and eight-part essays.

Through teasing with AI, we can find that every time he answers a question, he will bring the context with him for training. This is why he can understand the context better than other robots.

So the answer to this model is often not the most critical. The most critical thing is how to ask a good question and continue to follow this question. Reflected in daily life, it is like two people having a conversation, rather than a simple question and answer, which has no connection.

If the context is filled with irrelevant content, it will add a lot of junk content to the AI, making subsequent answers even more meaningless and often looking incorrect.

Thinking

With the emergence of such powerful AI, how can we programmers avoid being eliminated? Let's use magic to defeat magic. I have to say that the advice given by AI is still very pertinent.

It took another half an hour to connect ChatGPT to DingTalk robot.

Afen: What do you think of the emergence of ChatGPT? Will it have an impact on the programmer industry? At the same time, how should we as programmers avoid being eliminated by AI?

AI: The emergence of ChatGPT can help programmers develop programs more efficiently, but it will also bring challenges to programmers, because many repetitive coding tasks may be replaced by ChatGPT.

To avoid being eliminated by AI, programmers need to pay more attention to the depth of technology, constantly learn new technologies and methods, achieve value-driven software development, and cooperate with AI to achieve more efficient development.

In addition, programmers can also consider expanding their skills, such as learning a new programming language, understanding new software development tools, etc., in order to maximize and rationally use AI to improve their abilities and Competitiveness.

The above is the detailed content of It took another half an hour to connect ChatGPT to DingTalk robot.. 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