


WeChat mini program robot automatic customer service function
Nowadays, WeChat mini programs are more popular in development. This article will teach you a new function of WeChat: a mini program for customer service robots. This mini program can also be used to create other types of automatic customer service programs. It can add corresponding questions and answers to the olami platform. The answer is, that's it.
The entire mini program interface contains two parts, one for displaying answers and the other for input boxes. The core of the applet is to send an http request to the olami server, then process the results and display them. For detailed usage of the olami interface, please refer to the two blog posts at the top. The code to process the input is as follows:
bindInput: function (e) { var that = this; var input = e.detail.value; var timeStamp = new Date().getTime(); var sign = '1df21860a96a4509bcb50957bbdd6eccapi=nliappkey=382c5f83fb67458a99ca7b2eee17473etimestamp=' + timeStamp + '1df21860a96a4509bcb50957bbdd6ecc'; var MD5 = require('../../utils/MD5.js') sign = MD5.md5(sign); wx.request({ url: 'https://cn.olami.ai/cloudservice/api', data: { appkey: '382c5f83fb67458a99ca7b2eee17473e', api: 'nli', timestamp: timeStamp, sign: sign, rq: JSON.stringify({ "data_type": "stt", "data": { "input_type": 1, "text": input } }), cusid: app.globalData.custId, }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', success: function(res) { var result = ''; if (res.data.status == 'ok') { if (res.data.data.nli.length != 0) { result = res.data.data.nli[0].desc_obj.result } } that.setData({ userInfo: {}, userinput: '', result: result }) } }); },
The running effect is shown in the figure below:
Input
Result
Introduction to the help function
To implement the automatic customer service function, you only need the following A few steps:
1. Enter the nli system on the olami platform and create a new grammar module.
2. Enter the module, edit grammar, add questions that need support and corresponding answers.
The content in the picture is the supported questions. The platform's OSL grammar description language is used here, which can support multiple similar statements in one grammar. The osl language description is here. Of course, if you want to save trouble, you can just write a complete sentence, but in this case, you can only get the answer with this complete question.
Select the answer as the output method. You can add multiple answers below. These answers are randomly output. You can write multiple answers with the same meaning, so that it will not appear so monotonous.
Publish it after the grammar is completed.
If the module is configured in the application management, you can see in the mini program that the corresponding question has been answered. To add new supported questions in the future, just repeat steps 2 to 3.
The sentences supported by the customer service function are:
What kind of game is this?
What does this small program do?
What voice commands are there
How to play this game
The above is the tutorial on the automatic customer service function of the WeChat applet. I hope it will be helpful to everyone.
Related recommendations:
How to implement the image enlargement preview function in WeChat mini program
Introduction example of WeChat mini program development
Summary experience on mini program development
The above is the detailed content of WeChat mini program robot automatic customer service function. 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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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

Both vivox100s and x100 mobile phones are representative models in vivo's mobile phone product line. They respectively represent vivo's high-end technology level in different time periods. Therefore, the two mobile phones have certain differences in design, performance and functions. This article will conduct a detailed comparison between these two mobile phones in terms of performance comparison and function analysis to help consumers better choose the mobile phone that suits them. First, let’s look at the performance comparison between vivox100s and x100. vivox100s is equipped with the latest

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

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

With the rapid development of the Internet, the concept of self-media has become deeply rooted in people's hearts. So, what exactly is self-media? What are its main features and functions? Next, we will explore these issues one by one. 1. What exactly is self-media? We-media, as the name suggests, means you are the media. It refers to an information carrier through which individuals or teams can independently create, edit, publish and disseminate content through the Internet platform. Different from traditional media, such as newspapers, television, radio, etc., self-media is more interactive and personalized, allowing everyone to become a producer and disseminator of information. 2. What are the main features and functions of self-media? 1. Low threshold: The rise of self-media has lowered the threshold for entering the media industry. Cumbersome equipment and professional teams are no longer needed.

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

As Xiaohongshu becomes popular among young people, more and more people are beginning to use this platform to share various aspects of their experiences and life insights. How to effectively manage multiple Xiaohongshu accounts has become a key issue. In this article, we will discuss some of the features of Xiaohongshu account management software and explore how to better manage your Xiaohongshu account. As social media grows, many people find themselves needing to manage multiple social accounts. This is also a challenge for Xiaohongshu users. Some Xiaohongshu account management software can help users manage multiple accounts more easily, including automatic content publishing, scheduled publishing, data analysis and other functions. Through these tools, users can manage their accounts more efficiently and increase their account exposure and attention. In addition, Xiaohongshu account management software has

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

PHP Tips: Quickly implement the function of returning to the previous page. In web development, we often encounter the need to implement the function of returning to the previous page. Such operations can improve the user experience and make it easier for users to navigate between web pages. In PHP, we can achieve this function through some simple code. This article will introduce how to quickly implement the function of returning to the previous page and provide specific PHP code examples. In PHP, we can use $_SERVER['HTTP_REFERER'] to get the URL of the previous page
