FusionPBX to GPT4

Status
Not open for further replies.

Adrian Last

New Member
Apr 1, 2018
10
2
3
44
Connect Fusionbpx to Chat GPT4

Prerequisites
  1. https://platform.openai.com/account Signup for an account and assign it to the api_key variable
  2. https://azure.microsoft.com/en-us/free/cognitive-services and assign it to the SPEECH_KEY variable
  3. The following lua packages installed using lua-rocks (luasocket, cjson)
  4. json file attached. I think cjson will work too but I had some issues. Place this file in the lua5.x directory
  5. Enable mod_flite https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_flite_3965160/ -This is just to test. You can use Azure Text to Speech instead of mod_flite.
  6. Upload the switchgpt.lua files to /usr/share/freeswitch/scripts
  7. Setup a dialplan in Fusionpbx that will run the lua application

How does it work?
Place a call to the number assigned in the dialplan that's tied to the lua application and ask your question.
 

Attachments

  • json.lua
    9.4 KB · Views: 44
  • switchgpt.lua
    4.2 KB · Views: 52

Adrian Last

New Member
Apr 1, 2018
10
2
3
44
Remember to uncomment this line
session:speak("Welcome to the ChatGPT phone service. To ask a question, speak clearly after the beep, then press #") -- TESTING
 

Adrian Last

New Member
Apr 1, 2018
10
2
3
44
I could write a function to use Amazon pollytts
or
I could write a function to use pico which will generate the audio files locally
 

whut

Member
Dec 23, 2022
191
18
18
This looks interesting. I have been playing with chatgpt and other AI for a few weeks now and have been thinking of ways to use in fusionpbx. In my testing I discovered, no surprise, that gpu processing is so much faster than cpu processing. cpu processing is not going to be viable as it takes much too long.
 

Adrian Last

New Member
Apr 1, 2018
10
2
3
44
Using Microsoft TTS or Voice RSS is actually fast. Currently working on using GPT to automatically answer osticket user questions to reset passwords, suggest level 1 trouble shooting steps over the phone. The text-to-speech processes very fast only a slight slow response from openai gpt API.
 

whut

Member
Dec 23, 2022
191
18
18
Oh yes. I am interested in integrating with OS tickets. Potentially very useful functionality!
 

Adrian Last

New Member
Apr 1, 2018
10
2
3
44
It's scary accurate on ticket responses, a little too scary. I will post the finish Lua code when debugging is completed for you to test it.
 

whut

Member
Dec 23, 2022
191
18
18
It's scary accurate on ticket responses, a little too scary. I will post the finish Lua code when debugging is completed for you to test it.
Awesome! Yes it can be scary how " smart " The AI is, but that shows what time is it how powerful it is, and should be all the better for your needs.
I should have stated earlier that the heavy processing was using their whisper AI to transcribe audio and video files.
 
Status
Not open for further replies.