Skip to content

speakupnl/chatgpt-agi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Asterisk ChatGPT intergration - Proof of Concept

Read the blogpost about this here

A proof of concept AGI script that integrates Asterisk with ChatGPT to hold converstations with ChatGPT.

Deployment

Cloning and installing dependencies

Clone the repo somewhere on your Asterisk system. For example, to /usr/local/src/:

cd /usr/local/src/
git clone https://github.com/speakupnl/chatgpt-agi.git

Then, create a virtual environment and install the dependencies:

cd chatgpt-agi
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
deactivate

Make sure to replace the API key in chatgpt_agi.py to your own.

vim chatgpt_agi.py

Configuring Asterisk

Copy the chatgpt-welcome.wav or replace it with your own.

Please note, the actual path of your sounds directory may be different depending on your system.

cp chatgpt-welcome.wav /usr/share/asterisk/sounds/

Next, edit your extensions.conf.

vim /etc/asterisk/extensions.conf

Here is an example of what the dialplan might look like. Replace the phone number to your own.

exten = 31532401205,1,Noop(ChatGPT)
 same = n,answer()
 same = n,AGI(/usr/local/src/chatgpt-agi/venv/bin/python3 /usr/local/src/chatgpt-agi/openai_agi.py)

Reload the Asterisk dialplan

asterisk -rx 'dialplan reload'

And call away!

Troubleshooting

If you experience any trouble, check the Asterisk console:

asterisk -rvvv

or check the Asterisk syslog. On systems with systemd:

journalctl -fu asterisk

About

Integrate ChatGPT into Asterisk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages