Scroll export button | ||||||||
---|---|---|---|---|---|---|---|---|
|
Info |
---|
This Guide describes how to integrate ChatGPT with Wildix. Created: February 2023 Permalink: https://wildix.atlassian.net/wiki/x/AQBxC |
Table of Contents |
---|
Introduction
ChatGPT is a state-of-the-art language model developed by OpenAI, designed to generate human-like responses to natural language queries. It is built using deep learning techniques and trained on a massive amount of text data, which allows it to understand the nuances of human language and generate relevant and coherent responses.
...
- Wildix licensing
- For the primary settings of Kite Chatbot, consult Wildix WebRTC Kite Admin Guide
- Wildix Business Intelligence - Artificial Intelligence services
- OpenAI API documentation: https://platform.openai.com/docs/introduction
- To learn more about ChatGPT or the Kite Chatbot, you can watch the Wildix Tech Talk: Maximizing Efficiency with ChatGPT Webinar
Requirements
- Min. WMS version: starting from WMS 5.02.20210127
- Minimum Business license or higher (assigned to the chatbox user)
- Premium license for STT integration
- Last stable version of Node.js
Installation
- Download the archive: https://drive.google.com/file/d/1QM3nW0e2Wuo7FD2Gs168loOAMa8s47Dn/view?usp=share_link
- Open the archive, navigate to /kite-xmpp-bot-master/app and open config.js with an editor of your choice
Replace the following values with your own:
- domain: 'XXXXXX.wildixin.com' - domain name of the PBX
- service: 'xmpps://XXXXXX.wildixin.com:443', - domain name of the PBX
- username: 'XXXX', - Kitebot user extension number, do not change it
- password: 'XXXXXXXXXXXX' - Kitebot user password
- authorization: 'Bearer sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', - ChatGPT authorization token
- organization: 'org-XXXXXXXXXXXXXXXXXXXXXXXXX', – ChatGPT organization ID
- model: 'text-davinci-003', - this parameter specifies which GPT model to use for generating text. In this case, the model is set to 'text-davinci-003', which refers to the most advanced and powerful model available in OpenAI's GPT series of models
- temperature: 0.1, - this parameter controls the "creativity" of the generated text by specifying how much randomness should be introduced into the model's output
- externalmaxtokens: 250, - response token limit for Kite users contacting the chatbot
- internalmaxtokens: 500 - response token limit for internal users contacting the chatbot
- Upload the archive to the /home/admin/ directory using WinSCP or any alternative SFTP client
| - Connect to the web terminal. Log in as the super user via the su command, password wildix
Install nodejs:
Code Block apt-get install nodejs
Unzip the archive:
Code Block unzip /home/admin/kite-xmpp-bot-master.zip
Copy the chatbot folder to /mnt/backups:
Code Block cp -r ./kite-xmpp-bot-master /mnt/backups/
Move the chatbot.service.txt file to the appropriate directory and enable chatbot as a service to run in the background, then start the service:
Code Block cp /mnt/backups/kite-xmpp-bot-master/chatbot.service.txt /etc/systemd/system/chatbot.service systemctl enable chatbot.service systemctl daemon-reload systemctl start chatbot.service
Verify that the chatbot is running by either running the ps command:
Code Block ps aux | grep node
Or simply send the bot a message
The service sends standard and error output to wms.log so you can check /var/log/wms.log for debug if need be.
STT Dialplan configuration example using ChatGPT and speech recognition
Use case: to interact with ChatGPT via voice and have a response sent via TTS to the caller. Also contains a simple example of embedded prompt engineering in the Dialplan applications 6 & 7 where it checks whether or not the recognition result contains the word “price” then proceeds to add instructions for the ChatGPT API to respond in a short manner and only provide numerical value in the response when asked for a price of a particular item.
...